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

feat(GraphQL): @custom HTTP body now supports hardcoded scalars #6157

Merged
merged 5 commits into from
Aug 12, 2020

Conversation

abhimanyusinghgaur
Copy link
Contributor

@abhimanyusinghgaur abhimanyusinghgaur commented Aug 11, 2020

Fixes #5641
Fixes GRAPHQL-508
Fixes Discuss Issue

This PR adds support for parsing hardcoded scalar values in @custom HTTP body.
This also adds support for allowing _ in key names in the body template.


This change is Reviewable

@github-actions github-actions bot added the area/graphql Issues related to GraphQL support on Dgraph. label Aug 11, 2020
Copy link
Contributor

@pawanrawal pawanrawal left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 7 of 7 files at r1.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @abhimanyusinghgaur)


graphql/schema/wrappers.go, line 1866 at r1 (raw file):

// { "author" : "$id", "post": { "id": "$postID" }} and { "id": true, "postID": true}
// If the final result is not a valid JSON, then an error is returned.
// strictJSON should be false when the body template is being used for custom graphql arg parsing,

In strictJSON mode block strings and enums are invalid and should throw an error.


graphql/schema/wrappers_test.go, line 610 at r1 (raw file):

			nil,
			nil,
			errors.New("input:1: Unexpected ("),

Can we send this as part of the full error when a schema update happens?

@abhimanyusinghgaur abhimanyusinghgaur marked this pull request as ready for review August 11, 2020 15:53
Copy link
Contributor Author

@abhimanyusinghgaur abhimanyusinghgaur left a comment

Choose a reason for hiding this comment

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

Reviewable status: 4 of 7 files reviewed, 2 unresolved discussions (waiting on @MichaelJCompton and @pawanrawal)


graphql/schema/wrappers.go, line 1866 at r1 (raw file):

Previously, pawanrawal (Pawan Rawal) wrote…

In strictJSON mode block strings and enums are invalid and should throw an error.

Done.


graphql/schema/wrappers_test.go, line 610 at r1 (raw file):

Previously, pawanrawal (Pawan Rawal) wrote…

Can we send this as part of the full error when a schema update happens?

Done.

@abhimanyusinghgaur abhimanyusinghgaur merged commit 0d49e10 into master Aug 12, 2020
@abhimanyusinghgaur abhimanyusinghgaur deleted the abhimanyu/custom-http-scalar branch August 12, 2020 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/graphql Issues related to GraphQL support on Dgraph.
Development

Successfully merging this pull request may close these issues.

Custom Functions: Can't use _ in identifiers
2 participants