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

Using interface, scalar and union in shorthand type definitions #25

Closed
helfer opened this issue Apr 12, 2016 · 4 comments
Closed

Using interface, scalar and union in shorthand type definitions #25

helfer opened this issue Apr 12, 2016 · 4 comments
Milestone

Comments

@helfer
Copy link
Contributor

helfer commented Apr 12, 2016

Right now you can define sclars, interfaces and unions just fine, but there is no easy way to attach the functions they need to them. Off the top of my head (probably incomplete):

  • interface needs resolveType
  • union needs members to have ofType
  • scalar needs to have parseValue and serialize
@helfer
Copy link
Contributor Author

helfer commented Apr 13, 2016

The shorthand also doesn't support descriptions and deprecationReason.

@helfer
Copy link
Contributor Author

helfer commented Apr 13, 2016

One thing I'm thinking of doing to allow a workaround for these issues is to allow passing either a shorthand or a GraphQL-JS type into the schemaGenerator. That way the GraphQL-JS type definition could be used whenever the shorthand does not cut it.

@stubailo
Copy link
Contributor

Yeah that's a great idea!

@helfer helfer added this to the alpha milestone Apr 14, 2016
@helfer
Copy link
Contributor Author

helfer commented Apr 17, 2016

This PR implements the functionality in question via addResolveFunctionsToSchema.

@helfer helfer closed this as completed Apr 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants