Aryan Iyappan
SGStrawberry GraphQL
•Created by Aryan Iyappan on 6/28/2024 in #🤔questions
relay.GlobalID naming issue?
hey, are you using django by any chance?
29 replies
SGStrawberry GraphQL
•Created by Aryan Iyappan on 6/28/2024 in #🤔questions
relay.GlobalID naming issue?
Don't use strawberry.ID in the schema after defining your own ID scalar
29 replies
SGStrawberry GraphQL
•Created by Aryan Iyappan on 6/28/2024 in #🤔questions
relay.GlobalID naming issue?
Um, not really, you just need to define a new scalar (as mentioned above) and use it consistenly within the schema
29 replies
SGStrawberry GraphQL
•Created by Aryan Iyappan on 6/28/2024 in #🤔questions
relay.GlobalID naming issue?
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 instead29 replies
SGStrawberry GraphQL
•Created by Aryan Iyappan on 6/28/2024 in #🤔questions
relay.GlobalID naming issue?
hey @rodaan can you show me the logs of the TypeError?
29 replies
SGStrawberry GraphQL
•Created by Aryan Iyappan on 6/27/2024 in #🤔questions
Should I use dataloaders in relay.Node.resolve_nodes?
Oh that's actually a brilliant idea!
7 replies
SGStrawberry GraphQL
•Created by Aryan Iyappan on 6/27/2024 in #🤔questions
Should I use dataloaders in relay.Node.resolve_nodes?
off the top of my head, I think it would be nice if we could somehow pass the required argument to the dataloader, something like:
so that the dataloader fetch function can handle this logic..
7 replies
SGStrawberry GraphQL
•Created by Aryan Iyappan on 6/28/2024 in #🤔questions
relay.GlobalID naming issue?
But then again, this would be a major change and would require core Dev approval, any inputs guys?
29 replies
SGStrawberry GraphQL
•Created by Aryan Iyappan on 6/28/2024 in #🤔questions
relay.GlobalID naming issue?
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??
29 replies
SGStrawberry GraphQL
•Created by Aryan Iyappan on 6/28/2024 in #🤔questions
relay.GlobalID naming issue?
But then GlobalID would be nothing else but a class with a couple of methods- including from_id
29 replies
SGStrawberry GraphQL
•Created by Aryan Iyappan on 6/27/2024 in #🤔questions
Should I use dataloaders in relay.Node.resolve_nodes?
Oh, right! Thank you! So my doubt is.. is it a common pattern to implement two separate dataloaders: one which raises an error and another one which does not?
7 replies
SGStrawberry GraphQL
•Created by Aryan Iyappan on 6/28/2024 in #🤔questions
relay.GlobalID naming issue?
Sure, at the top of my head, I'm thinking, we separate the resolve_node and resolve_node_sync methods into standalone functions
29 replies
SGStrawberry GraphQL
•Created by Aryan Iyappan on 6/28/2024 in #🤔questions
relay.GlobalID naming issue?
Could we redo the API such that the globalID.resolve_node and globalID.resolve_node_sync methods are separate, standalone functions?
@bellini 🤔
29 replies
SGStrawberry GraphQL
•Created by Aryan Iyappan on 6/28/2024 in #🤔questions
relay.GlobalID naming issue?
Would prs on this be accepted? I would like to contribute!
29 replies
SGStrawberry GraphQL
•Created by Aryan Iyappan on 6/28/2024 in #🤔questions
relay.GlobalID naming issue?
Mm, I think it would be nice if we could still keep the global id abstraction, just not make it a scalar
29 replies
SGStrawberry GraphQL
•Created by Aryan Iyappan on 6/28/2024 in #🤔questions
relay.GlobalID naming issue?
29 replies
SGStrawberry GraphQL
•Created by Aryan Iyappan on 6/28/2024 in #🤔questions
relay.GlobalID naming issue?
cc @contributors
29 replies
SGStrawberry GraphQL
•Created by Aryan Iyappan on 6/28/2024 in #🤔questions
relay.GlobalID naming issue?
the relay specification calls this scalar as
ID
only, so why is strawberry outputting this as GlobalID
??29 replies
SGStrawberry GraphQL
•Created by Aryan Iyappan on 6/28/2024 in #🤔questions
relay.GlobalID naming issue?
Here's the error I get from relay:
29 replies
SGStrawberry GraphQL
•Created by Aryan Iyappan on 6/28/2024 in #🤔questions
relay.GlobalID naming issue?
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 directives29 replies