15 Replies
this is the schema currently being generated while using the strawberry relay integration.
However, this outputs all the IDs under a scalar named
GlobalID
The issue for me is, while using relay on the frontend, the relay compiler expects these fields to be of the scalar named ID
exactly, while updating the data after mutations, using directives
Here's the error I get from relay:
the relay specification calls this scalar as ID
only, so why is strawberry outputting this as GlobalID
??
cc @contributorsGitHub
(Relay) Output ID instead of GlobalID in GraphQL schema · Issue #35...
Request to output the ID scalar instead of GlobalID, while generating the GraphQL schema My understanding is that GlobalID was meant to be an internal helper that resolves nodes, but ended up being...
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Mm, I think it would be nice if we could still keep the global id abstraction, just not make it a scalar
Would prs on this be accepted? I would like to contribute!
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Could we redo the API such that the globalID.resolve_node and globalID.resolve_node_sync methods are separate, standalone functions?
@bellini 🤔
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Sure, at the top of my head, I'm thinking, we separate the resolve_node and resolve_node_sync methods into standalone functions
But then GlobalID would be nothing else but a class with a couple of methods- including from_id
So that raises a question- why not make the relay node types return the ID type directly itself? As in other implementations such as graphql-relay-js??
But then again, this would be a major change and would require core Dev approval, any inputs guys?
Unknown User•3mo ago
Message Not Public
Sign In & Join Server To View
hey @rodaan can you show me the logs of the TypeError?
I think the issue is, after creating a scalar like this;
You are using
strawberry.ID
in your schema.
You should be using your own ID scalar insteadUnknown User•3mo ago
Message Not Public
Sign In & Join Server To View
Um, not really, you just need to define a new scalar (as mentioned above) and use it consistenly within the schema
Don't use strawberry.ID in the schema after defining your own ID scalar
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View
hey, are you using django by any chance?
Unknown User•2mo ago
Message Not Public
Sign In & Join Server To View