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

@interfaceObject example doesn't work #2934

Open
jhanggi opened this issue Feb 9, 2024 · 2 comments
Open

@interfaceObject example doesn't work #2934

jhanggi opened this issue Feb 9, 2024 · 2 comments

Comments

@jhanggi
Copy link

jhanggi commented Feb 9, 2024

Issue Description

I was having trouble composing my schema with @interfaceObject, and what I had is almost identical to the example provided.

See my reproduction https://github.com/jhanggi/apollo-interface-obj-bug

I get the same errors there, and what's particularly weird is different errors between rover supergraph compose and rover dev

Any ideas?

Running rover 0.22.0

⌛ resolving SDL for subgraphs defined in ./supergraph.yml
🎶 composing supergraph with Federation v2.3.2
HINT: [INCONSISTENT_INTERFACE_VALUE_TYPE_FIELD]: Field "Media.title" of interface type "Media" is defined in some but not all subgraphs that define "Media": "Media.title" is defined in subgraph "graph-a" but not in subgraph "graph-b".
HINT: [INCONSISTENT_INTERFACE_VALUE_TYPE_FIELD]: Field "Media.reviews" of interface type "Media" is defined in some but not all subgraphs that define "Media": "Media.reviews" is defined in subgraph "graph-b" but not in subgraph "graph-a".

I thought the whole point of @interfaceObject was that different subgraphs could contribute different fields to an interface.

It appears as if it does successfully generate a schema, though.

Rover dev has a different problem (besides the fact it is ignoring the federation version in supergraph.yml):

> rover dev --supergraph-config ./supergraph.yml
⚠️  Do not run this command in production! ⚠️  It is intended for local development.
🛫 starting a session with the 'graph-b' subgraph
🛫 starting a session with the 'graph-a' subgraph
🎶 composing supergraph with Federation v2.6.1
error[E029]: Encountered 1 build error while trying to build a supergraph.

Caused by:
    INTERFACE_OBJECT_USAGE_ERROR: Type "Media" is declared with @interfaceObject in all the subgraphs in which is is defined (it is defined in subgraph "graph-b" but should be defined as an interface in at least one subgraph)

Link to Reproduction

https://github.com/jhanggi/apollo-interface-obj-bug

Reproduction Steps

No response

@jhanggi
Copy link
Author

jhanggi commented Feb 9, 2024

In my application, I found that the rover dev, the supergraph does still spin up even with the INTERFACE_OBJECT_USAGE_ERROR, and everything seems to resolve correctly.

@jhanggi
Copy link
Author

jhanggi commented Feb 15, 2024

I found that if I update the federation_version to 2.6 in the supergraph.yml, it works with rover supergraph compose, but still doesn't work with rover dev

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

1 participant