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

fix(GraphQL): Disallow Subscription typename. #6077

Merged
merged 6 commits into from
Jul 28, 2020
Merged

Conversation

JatinDev543
Copy link
Contributor

@JatinDev543 JatinDev543 commented Jul 27, 2020

This PR disallow Subscription typename so that it doesn't conflict with Subscriptions generated.


This change is Reviewable

@github-actions github-actions bot added the area/graphql Issues related to GraphQL support on Dgraph. label Jul 27, 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.

Reviewed 3 of 3 files at r1.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @jatindevdg and @MichaelJCompton)


graphql/schema/gqlschema_test.yml, line 2693 at r1 (raw file):

        owns: [Object] @dgraph(pred: "~Object.owner")
      }

Why add newlines here?


graphql/schema/rules.go, line 275 at r1 (raw file):

		"StringExactFilter":    true,
		"StringHashFilter":     true,
		"Subscription":         true,

Why is it forbidden as an input name as well? I thought we only forbid it as a typename.


graphql/schema/rules.go, line 1785 at r1 (raw file):

func isReservedKeyWord(name string) bool {
	if isScalar(name) || isQueryOrMutation(name) || isReserve(name) {

instead of creating a function called isReserve, just define the map here in this function and use it.


graphql/schema/schemagen_test.go, line 170 at r1 (raw file):

				_, authError := FromString(schHandler.GQLSchema())

Any reason to remove this newline?

Copy link
Contributor Author

@JatinDev543 JatinDev543 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: 0 of 2 files reviewed, 4 unresolved discussions (waiting on @MichaelJCompton and @pawanrawal)


graphql/schema/gqlschema_test.yml, line 2693 at r1 (raw file):

Previously, pawanrawal (Pawan Rawal) wrote…

Why add newlines here?

By mistake, deleted now.


graphql/schema/rules.go, line 275 at r1 (raw file):

Previously, pawanrawal (Pawan Rawal) wrote…

Why is it forbidden as an input name as well? I thought we only forbid it as a typename.

yeah not required, i checked and deleted it.


graphql/schema/rules.go, line 1785 at r1 (raw file):

Previously, pawanrawal (Pawan Rawal) wrote…

instead of creating a function called isReserve, just define the map here in this function and use it.

changed it.


graphql/schema/schemagen_test.go, line 170 at r1 (raw file):

Previously, pawanrawal (Pawan Rawal) wrote…

Any reason to remove this newline?

This is also by mistake, deleted now .

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 3 of 3 files at r2.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @MichaelJCompton and @pawanrawal)

@JatinDev543 JatinDev543 merged commit 601e837 into master Jul 28, 2020
@JatinDev543 JatinDev543 deleted the jatin/graphql-587 branch July 28, 2020 16:00
JatinDev543 added a commit that referenced this pull request Aug 13, 2020
This PR disallow Subscription typename so that it doesn't conflict with Subscriptions generated.

(cherry picked from commit 601e837)
JatinDev543 added a commit that referenced this pull request Aug 13, 2020
This PR disallow Subscription typename so that it doesn't conflict with Subscriptions generated.

(cherry picked from commit 601e837)
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.

2 participants