Aryan Iyappan
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;
ID = strawberry.scalar(
strawberry.ID,
serialize=lambda value: str(value),
parse_value=lambda value: GlobalID.from_id(value=value),
)
ID = strawberry.scalar(
strawberry.ID,
serialize=lambda value: str(value),
parse_value=lambda value: GlobalID.from_id(value=value),
)
You are using strawberry.ID in your schema. You should be using your own ID scalar instead
29 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:
dataloader.load_many(keys, required=True)
dataloader.load_many(keys, required=True)
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