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 panic when no schema exists for a new namespace (GRAPHQL-1073) #7630

Merged
merged 2 commits into from
Mar 22, 2021

Conversation

abhimanyusinghgaur
Copy link
Contributor

@abhimanyusinghgaur abhimanyusinghgaur commented Mar 22, 2021

This PR fixes the issue where if you create a new namespace and run a GraphQL query for the newly created namespace without first applying any GraphQL schema, then you would get a panic in alpha.
Now, such a query will not result in panic, but instead will give back a similar response:

{
  "errors": [
    {
      "message": "Not resolving getAuthor. There's no GraphQL schema in Dgraph.  Use the /admin API to add a GraphQL schema"
    }
  ]
}

This change is Reviewable

@github-actions github-actions bot added the area/graphql Issues related to GraphQL support on Dgraph. label Mar 22, 2021
graphql/admin/admin.go Show resolved Hide resolved
graphql/e2e/multi_tenancy/schema_test.go Outdated Show resolved Hide resolved
@abhimanyusinghgaur abhimanyusinghgaur merged commit 1f1e9b9 into release/v21.03 Mar 22, 2021
@abhimanyusinghgaur abhimanyusinghgaur deleted the abhimanyu/fix-handler branch March 22, 2021 11:23
@abhimanyusinghgaur abhimanyusinghgaur changed the title fix(GraphQL): Fix panic when no schema exists for a new namespace fix(GraphQL): Fix panic when no schema exists for a new namespace (GRAPHQL-1073) Mar 22, 2021
aman-bansal pushed a commit that referenced this pull request Mar 25, 2021
)

This PR fixes the issue where if you create a new namespace and run a GraphQL query for the newly created namespace without first applying any GraphQL schema, then you would get a `panic` in alpha.
Now, such a query will not result in `panic`, but instead will give back a similar response:
```
{
  "errors": [
    {
      "message": "Not resolving getAuthor. There's no GraphQL schema in Dgraph.  Use the /admin API to add a GraphQL schema"
    }
  ]
}
```
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