-
Notifications
You must be signed in to change notification settings - Fork 2k
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
buildType
that mirrors buildSchema
but for types
#474
Comments
I kind of needed this ASAP so I ended up writing my own. It works pretty well and has some nice shortcuts (like the I'm not sure if GraphQL.js (as a reference implementation) should have complex utilities like this one, if it's something within it's scope I wouldn't mind doing a PR. If it's outside the scope then I'll keep developing it on that repo. |
It's worth mentioning that the implementation of |
Closing since, #597 has the bigger scope that fully incorporates this issue. |
Now that we have
buildSchema
it would be nice to also have abuildType
to create custom types using IDL. The main benefit would be code separation.GraphQL schema for large APIs are quite big and often it's beneficial to separate types in different files. Right now
graphql-tools
offersmakeExecutableSchema
which can take an array of strings (IDL), each defining a type. Then you have to useaddResolveFunctionsToSchema
to add resolvers.It would be great if we could build types using IDL and passing any other required functions as a map (
buildType(IDL, config)
).buildType
would take care offields
andargs
internally.buildSchema
could then be modified to take an array of types so that the schema is executable (including field resolution).Thoughts?
The text was updated successfully, but these errors were encountered: