-
Notifications
You must be signed in to change notification settings - Fork 59
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
How to use fragments if model names differ? #67
Comments
Thanks a lot for reporting this @nickluger. This definitely seems like something that should be address (and might be possibly linked to the underlying |
@freiksenet is this something that should be easier/solved given the new transformation API? |
Any progress on this issue? Is there a workaround for this? |
Thank you for reporting. In the last few months, since the transition of many libraries under The Guild's leadership, We've reviewed and released many improvements and versions to graphql-cli, graphql-config and graphql-import. We've reviewed What we've found is that the new GraphQL Mesh library is covering not only all the current capabilities of GraphQL Binding, but also the future ideas that were introduced in the original GraphQL Binding blog post and haven't come to life yet. And the best thing - GraphQL Mesh gives you all those capabilities, even if your source is not a GraphQL service at all! Just like GraphQL Binding, you get a fully typed SDK (thanks to the protocols SDKs and the GraphQL Code Generator), but from any source, and that SDK can run anywhere, as a connector or as a full blown gateway. If you think that we've missed anything from GraphQL Binding that is not supported in a better way in GraphQL Mesh, please let us know! In the context of that particular issue - GraphQL Mesh uses the new schema stitching introduced in GraphQL Tools v6 and I believe this issue should be solved there. If you believe not, feel free to open a new issue on the GraphQL Mesh repo. We're looking forward for your feedback of how we can make your experience even better! |
In the following i'm using prisma-binding as an example.
Let's say we have a
User
model in Prisma and aPrivateProfile
model in Yoga which maps and relays to the user model.I have a resolver
me
, which uses this prisma-binding callI'm sending this from playground:
I'm receiving this response:
This is the request sent to Prisma:
It is clear why this happens. Fragments are named. If we take a look into the info object:
we get
'PrivateProfile'
which does not exist in Prisma, only in our Yoga schema. The fragment should be defined on
User
instead.So if we do:
At least the error disappears and i get from Prisma:
Still Yoga, does not return the correct response to the client, but at least Prisma does.
How can i use fragments in the bound API and my frontend interface, if my model names are not the same?
The text was updated successfully, but these errors were encountered: