Skip to content
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

describe a node's type as a string #87

Open
davidism opened this issue Jul 26, 2023 · 0 comments
Open

describe a node's type as a string #87

davidism opened this issue Jul 26, 2023 · 0 comments
Assignees
Milestone

Comments

@davidism
Copy link
Member

When testing, you may want to check the type of a node as it will appear in the final GraphQL schema. If you've called schema.to_graphql() to finalize the types, then because of caching you can do node1.type is User.non_null.list and it will compare equal by identity. But this won't work for wrapping types that were created from string references, such as NonNull("User").list, because only the properties can cache.

It would be useful to always get the node's type as a string, such as "[User!]", regardless of if you specified the type as a string or an instance. Add a type_str property to make it possible to do node.type_str == "[User!]".

@davidism davidism self-assigned this Jul 27, 2023
@davidism davidism added this to the 1.1.0 milestone Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant