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

Add NullID nullable type #627

Merged
merged 2 commits into from
Dec 20, 2023

Conversation

Slessi
Copy link
Contributor

@Slessi Slessi commented Dec 13, 2023

Following up on #210 - This adds the NullID type to handle the nullable ID case

return name == "ID"
}

func (s *NullID) UnmarshalGraphQL(input interface{}) error {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After s.Set = true it would be better to reuse the UnmarshalGraphQLType from the graphql.ID type.
https://github.com/graph-gophers/graphql-go/blob/master/id.go#L15
What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to replace *string with *graphql.ID to do that, LMK if you think its more correct this way

53cca00

@pavelnikolov pavelnikolov merged commit a3a932c into graph-gophers:master Dec 20, 2023
2 checks passed
@Slessi Slessi deleted the slessi/add-graphql-nullid branch December 20, 2023 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants