Skip to content

explicit_requires: true is not respected when using @entityResolver(multi: true) #3742

@parkerroan

Description

@parkerroan

The federation.requires.go file and function will still be generated, but the function will not be called/used in the federation.go file. This becomes an issue when you have an array of objects that are required and you also need to use @entityResolver(multi: true)

Schema to reproduce:

type Product @key(fields: "id") @entityResolver(multi: true)  {
  id: ID!
  someField: [SomeItem!]
  price: Float! @requires(fields: "someField {key value}") @goField(forceResolver: true)
}

type SomeItem {
  key: String!
  value: String!
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    federationRelated to Apollo federationhelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions