Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure build for building GraphQLSchema #5

Open
migueloller opened this issue Sep 6, 2016 · 1 comment
Open

Restructure build for building GraphQLSchema #5

migueloller opened this issue Sep 6, 2016 · 1 comment

Comments

@migueloller
Copy link
Owner

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 build will 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 build wouldn'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.

migueloller added a commit that referenced this issue Sep 6, 2016
Also removed support for `types` and `directives` in schema. See #5.
@migueloller migueloller added this to the v0.1.0 milestone Sep 6, 2016
@migueloller
Copy link
Owner Author

migueloller commented Sep 6, 2016

For the next release (v0.1.0) we'll do the following:

  • Keep schema inference with operations in any combination of AST or type dependencies. Good error messages (Error messages for better developer experience #4) are critical for this. We'll remove inferred schemas for simplicity and add it in the future if it's something developers want.
  • Good error messages (Error messages for better developer experience #4) will be ok for forcing array as type dependencies for schema definitions.
  • Directives and types will be able to be passed on to the schema via __schema.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant