Skip to content

Wrong assumption on argument count for implementation of interfaces #1897

Closed

Description

@cjanietz

Describe the bug
Currently this library assumes and validates that the amount of arguments a field has on the interface and implementing object has to be the same. However this assumption is not true according to GraphQL Spec (see: https://github.com/graphql/graphql-spec/blob/master/spec/Section%203%20--%20Type%20System.md - IsValidImplementation(type, implementedType)). An implementing type may add optional arguments to the field. The library will then produce an error as:
object type 'Person' does not implement interface 'User' because field 'groups' has a different number of arguments

To Reproduce

interface User {
  id: String!
  groups: UserGroupList!
}

type Person implements User {
  id: String!
  groups(name: StringFieldFilter): UserGroupList!
}

Activity

  1. cjanietz commented on May 18, 2020

    @cjanietz
    Author

    The implementation in #1884 seems to fix this, waiting for it to be merged

  2. felipe-gdr commented on May 18, 2020

    @felipe-gdr
    Member

    @cjanietz , #1884 actually doesn't fix this.
    I'll look into fixing this one as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions