Skip to content

GraphQL: "Non-nullable field was not present in result" on identically named fields under interface #5516

@CosmicPangolin

Description

@CosmicPangolin

What version of Dgraph are you using?

2020.03.1

Have you tried reproducing the issue with the latest release?

Yah

What is the hardware spec (RAM, OS)?

GCloud 8GB VM

Steps to reproduce the issue (command/config used to run Dgraph).

Consider the following schema:

type User {
     id: ID!
}

interface Things {
    id: ID!
    name: String!
}

type Stuff {
    id: ID!
    things: [Things!]
}

type ThingOne implements Things {
    creator: User!
}

type ThingTwo implements Things {
    creator: User!
}

type ThingThree implements Things {
    randomField: Int!
}

And, for Stuff containing some Things, a query of the form:

query {
     getStuff(id: "1337") {
          things {
               ...on ThingOne { creator {id} }
               ...on ThingTwo { creator {id} }
               ...on ThingThree { randomField }
          }
     }
}

Expected behaviour and actual result.

This query fails with "Non-nullable field was not present in result" for one of the creator fields. This seems to only be the case when fields share the same name, types share the same interface, but field is not in interface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/graphqlIssues related to GraphQL support on Dgraph.kind/bugSomething is broken.status/acceptedWe accept to investigate/work on it.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions