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

Reference Resolver on Interface not working #67

Open
cli00004 opened this issue Jan 10, 2024 · 2 comments
Open

Reference Resolver on Interface not working #67

cli00004 opened this issue Jan 10, 2024 · 2 comments

Comments

@cli00004
Copy link

cli00004 commented Jan 10, 2024

I have an interface type in Graph 1 and an interfaceObject in Graph 2 matching each other (let's say interface A). When a query initiated from graph 2 referencing object from graph 1 with reference resolver, graph 1 will throw exception The apollo gateway tries to resolve an entity for which no EntityResolver method was found even though I have defined the reference resolver in the interface type in Graph 1

Updates:
It looks like EntitiesResolver only tries to locate resolver from ObjectType, but by definition here https://www.apollographql.com/docs/federation/federated-types/interfaces#interface-reference-resolver , resolvers can also be defined in interface type
image

@cli00004 cli00004 changed the title Reference Resolver on Interface doesn't seem to work Reference Resolver on Interface not working Jan 10, 2024
@dariuszkuc
Copy link
Member

Hello 👋
Can you provide a link to a github repository that reproduces the issue?

@cli00004
Copy link
Author

cli00004 commented Jan 10, 2024

hi @dariuszkuc , sorry I won't be able to provide the github as that's currently under private corporate account, but I debug through it and found issue happens here

if (schema.TryGetType<ObjectType>(current.TypeName, out var objectType) &&
where the EntitiesResolver only looks for resolvers in ObjectType, but I have an ReferenceResolver defined in a InterfaceType class, which should be supported in Federation 2.0, hope this makes sense

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

No branches or pull requests

2 participants