-
Notifications
You must be signed in to change notification settings - Fork 223
[WIP] Graphql schema language configuration #254
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
[WIP] Graphql schema language configuration #254
Conversation
mcg-web
commented
Nov 30, 2017
Q | A |
---|---|
Bug fix? | no |
New feature? | yes |
BC breaks? | no |
Deprecations? | no |
Tests pass? | yes |
Documented? | yes |
Fixed tickets | #12 |
License | MIT |
To be honest I don't really like the proposed yaml configuraion from the docs
It's simply too much writing and things about certain type are split across too many files - the graphql schema file, decorator configuration and the resolver itself. Instead I'd like to add resolver for a type using a tagged service. Something like: services:
App\GraphQL\FooTypeResolver:
tags:
- { name: graphql.typeResolver, type: Foo }
App\GraphQL\BarFieldResolver:
tags:
- { name: graphql.fieldResolver, type: Query, field: bar } This would remove the wtf syntax What do you think? |
I like this proposal! But some points should be clarify, what will be done if many resolvers tagging the same fields? Does this mean we introduce cascades resolving just like promises? |
For now, simply throw an exception (KISS). Such features can be added later with a clear use-case in mind. I don't really expect such feature to be necessary. One thing I did not consider is how to add descriptions or if there are any other metadata that can't be in the schema directly. I don't have enough GraphQL experience to know what else is needed. Maybe the resolver could have a second method to return such things? |
@mcg-web don't wanna work on it anymore? |
@renatomefi WIP, I closed that one to don't spam subscribers because I'm going in a different direction with resolvers. |