dgraph-io / dgraph-io/dgraph

GraphQL 2021 edition interfaces implementing interfaces

Open
#9,472 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Stale
Dominant language
Go
Stars
21.8k
Forks
1.6k
Avg merge
2d 5h
Merged PRs (30d)
9

Description

Describe the bug

In the specs for the 2021 edition of GraphQL there is the possibility of defining interfaces that implemnent other interfaces: https://spec.graphql.org/October2021/#sec-Interfaces.Interfaces-Implementing-Interfaces but DGraph does not support it.

To Reproduce

Attempt to load the following schema to a DGraph node:

interface Node {
  id: ID!
}

interface Resource implements Node {
  id: ID!
  url: String
}

type Image implements Resource & Node {
  id: ID!
  url: String
  thumbnail: String
}

The upload (via http API) fails with the following error message:

{"errors":[{"message":"resolving updateGQLSchema failed because input:5: Unexpected Name \"implements\"\n (Locations: [{Line: 3, Column: 4}])","extensions":{"code":"Error"}}]}

Expected behavior

The schema should be valid and uploaded.

Environment

dgraph/standalone:v25.0.0-preview6 docker image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with the HTTP API schema-upload path and the GraphQL parser or validation handling for interface definitions. Reproduce the failure with the schema in the issue, then add a regression case covering an interface implementing another interface. Done means the schema uploads successfully and the existing GraphQL behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, graphql
Domain
api, database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.