-
Notifications
You must be signed in to change notification settings - Fork 8
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
GraphQL service does not support interfaces #33
Comments
I got help on this one recently from @johannessteu , and I still owe an update on the readme on how to do that :-) You have to simply implement a For your case that would look something like this:
Hope that helps. |
@robertlemke didn't we tested that also 🤔 |
ping @robertlemke |
@johannessteu @robertlemke I have the same error ...
Error: |
It was a configuration my resolver was not loaded correctly, everything works fine now |
My final resolver looks like this |
As far as I can see – and I tried and played with this for a couple of hours – interfaces are not yet supported.
My concrete use case is implementing the server specification for Relay, which enables me to provide cursor-based pagination and universal object identification.
Given the following minimal GraphQL schema:
resolveType
When I submit any query, I will receive an exception:
Just for good measure, I tried setting that validation option to false, but there is currently no way to do that in the Flow package (it is possible programmatically in the GraphQLTools package).
To fix this, we need a way to provide a custom
resolveType
function. Ideally, Flow would automatically recognize such a function in my Resolver class.internal error in response
I temporarily solved the first problem by hardcoding the resolve type as follows:
Now the schema warning is gone.
When I try to query a node as follows:
I receive a inexpressive error:
In the resolver, I tried solving the issue by returning different kinds of data. Among them, a
CustomerAccount
class (which supports JsonSerialize), an array based on CustomerAccount, a literal, an array with just an id:I'm a bit clueless about what the correct data would be to return in the query function.
The text was updated successfully, but these errors were encountered: