-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
Milestone
Description
There are various problems when trying to build a schema that make the API more confusing.
- Inferring a schema comes with the problem of it not being intuitive where
buildwill check for the operations. Can they all be type dependencies? Do they all have to be in the AST? - Schema must declare directives and types and these cannot be lazily evaluated, meaning that for this particular use case
buildwouldn't support thunks for type dependencies. This is inconsistent. - Finally, because a GraphQL schema does not have a name, it's impossible to deterministically set the schema config via the config argument of
build.
Perhaps it would be best to delegate schema creation to a separate function and use build only for types. While it adds an extra function it reduces complexity by separating concerns.