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) fix empty type Query with single extended type definition in the schema. #7517

Merged
merged 3 commits into from
Mar 5, 2021

Conversation

minhaj-shakeel
Copy link
Contributor

@minhaj-shakeel minhaj-shakeel commented Mar 4, 2021

Fixes GRAPHQL-1060.


This change is Reviewable

@github-actions github-actions bot added the area/graphql Issues related to GraphQL support on Dgraph. label Mar 4, 2021
Copy link
Contributor

@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: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @minhaj-shakeel and @pawanrawal)


graphql/schema/gqlschema.go, line 2558 at r1 (raw file):

Quoted 7 lines of code…
	queriesToWrite := false
	for _, fld := range schema.Query.Fields {
		if !strings.HasPrefix(fld.Name, "__") {
			queriesToWrite = true
			break
		}
	}

let's put this logic in a function called hasStringifiableFields(typ *ast.Type) bool and use that

@minhaj-shakeel minhaj-shakeel merged commit a77939a into master Mar 5, 2021
aman-bansal pushed a commit that referenced this pull request Mar 9, 2021
@minhaj-shakeel minhaj-shakeel deleted the minhaj/empty-type branch April 22, 2021 04:27
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