Skip to content

fix(GraphQL) fix empty type Query with single extended type definition in the schema.#7517

Merged
minhaj-shakeel merged 3 commits intomasterfrom
minhaj/empty-type
Mar 5, 2021
Merged

fix(GraphQL) fix empty type Query with single extended type definition in the schema.#7517
minhaj-shakeel merged 3 commits intomasterfrom
minhaj/empty-type

Conversation

@minhaj-shakeel
Copy link
Copy Markdown
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
Copy Markdown
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