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

Apollo Federation Reference resolver with nested fields doesn't work if parent field is non nullable #6594

Closed
1 task done
darren-clark opened this issue Oct 12, 2023 · 0 comments · Fixed by #6596
Closed
1 task done

Comments

@darren-clark
Copy link
Contributor

Is there an existing issue for this?

  • I have searched the existing issues

Product

Hot Chocolate

Describe the bug

When an entity key includes fields of fields, the ArgumentParser fails if any object type fields are required.

Steps to reproduce

schema:

type Entity @key(fieldset: "type detail { id }") {
  id: ID!
  type: EntityType!
  detail: Detail!
}

enum EntityType {
 TYPE_A
 TYPE_B
}
type Detail {
 id: ID!
}
[ReferenceResolver]
public static Entity Resolve(EntityType entityType,  [Map("detail.id")] string detailId)
....

detailId will always be null, with no error from the pipeline

However if Entity is defined as:

type Entity @key(fieldset: "type detail { id }") {
  id: ID!
  type: EntityType!
  detail: Detail
}

where detail is optional, then it works.

Relevant log output

No response

Additional Context?

Somewhat related to #6232 , only in this case it's the IType parameter that isn't being properly handled.

If type is NonNullType it fails the type check at

                if (type is not IComplexOutputType complexType ||
                    !complexType.Fields.TryGetField(current, out var field))

Version

13.5.1

darren-clark pushed a commit to darren-clark/graphql-platform that referenced this issue Oct 12, 2023
darren-clark added a commit to darren-clark/graphql-platform that referenced this issue Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants