When using the api SDL (Schema definition language) as a review tool for schema, changes it's really useful to print the root first, then the children nodes.
Graphql-core respects that, but strawberry's implementation does not
Minimal demo
import strawberry
import typing
from graphql import print_schema
@strawberry.type
class Book:
title: str
author: str
def books():
return []
@strawberry.type
class Query:
books: typing.List[Book] = strawberry.field(resolver=books)
schema = strawberry.Schema(query=Query)
with open('schema_strawberry.gql', 'w+') as f:
f.write(str(schema))
with open('schema_core.gql', 'w+') as f:
f.write(print_schema(schema._schema))
After executing python bug_demo.py
one can see that strawberry prints this
type Book {
title: String!
author: String!
}
type Query {
books: [Book!]!
}
Instead of graphql-core output
type Query {
books: [Book!]!
}
type Book {
title: String!
author: String!
}
strawberry-graphql==0.65.3
graphql-core==3.1.5
Python 3.8.5
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too