Comments (1)
Hi @ccnklc 👋 thanks for submitting this issue. I just merged a fix ☝️
I have just set up the application, push my first managed federated graph to apollo, although you definitely need to update the federated section of the initial graph generation as the example code was not working properly.
I did a fresh clone of the repo and ran make demo-managed
and saw a few temporary WARN: The following composition errors occurred
messages, but after all subgraphs were published, I got The gateway for the 'supergraph-test' graph was updated with a new schema, composed from the updated 'users' subgraph
.
This is confusing though, because it's not really clear just glancing at it that composition was successful. I've submitted apollographql/rover#632 to help make this more clear, and also cleaned up the output in the demo. If you're seeing some other error please let us know!
make demo-managed results
make demo-managed
-------------------------------------------------------------------------------------------
Enter your Graph API Key
-------------------------------------------------------------------------------------------
Go to your graph settings in https://studio.apollographql.com/
then create a Graph API Key with Contributor permissions
(for metrics reporting) and enter it at the prompt below.
>
-------------------------------------------------------------------------------------------
Graph Ref
-------------------------------------------------------------------------------------------
Go to your graph settings in https://studio.apollographql.com/
then copy your Graph NAME and optionally @<VARIANT> and enter it at the prompt below.
@<VARIANT> will default to @current, if omitted.
Enter the <NAME>@<VARIANT> of a federated graph in Apollo Studio:
> supergraph-test@dev
.scripts/publish.sh default
-------------------------------------------------------------------------------------------
using: supergraph-test@dev
-------------------------------------------------------------------------------------------
subgraphs:
+ rover subgraph publish supergraph-test@dev --routing-url http://inventory:4000/graphql --schema subgraphs/inventory/inventory.graphql --name inventory --convert
Publishing SDL to supergraph-test:dev (subgraph: inventory) using credentials from the default profile.
A new subgraph called 'inventory' for the 'supergraph-test' graph was created
The gateway for the 'supergraph-test' graph was NOT updated with a new schema
WARN: The following composition errors occurred:
[inventory] Product -> `Product` is an extension type, but `Product` is not defined in any service
Type Query must define one or more fields.
+ rover subgraph publish supergraph-test@dev --routing-url http://products:4000/graphql --schema subgraphs/products/products.graphql --name products --convert
Publishing SDL to supergraph-test:dev (subgraph: products) using credentials from the default profile.
A new subgraph called 'products' for the 'supergraph-test' graph was created
The gateway for the 'supergraph-test' graph was NOT updated with a new schema
WARN: The following composition errors occurred:
Unknown type "User".
[products] Query -> `Query` is an extension type, but `Query` is not defined in any service
Unknown type "Product".
Unknown type "Product".
[products] User -> `User` is an extension type, but `User` is not defined in any service
[inventory] Product -> `Product` is an extension type, but `Product` is not defined in any service
Unknown type "DeliveryEstimates".
Query root type must be provided.
+ rover subgraph publish supergraph-test@dev --routing-url http://users:4000/graphql --schema subgraphs/users/users.graphql --name users --convert
Publishing SDL to supergraph-test:dev (subgraph: users) using credentials from the default profile.
A new subgraph called 'users' for the 'supergraph-test' graph was created
The gateway for the 'supergraph-test' graph was updated with a new schema, composed from the updated 'users' subgraph
docker-compose -f docker-compose.managed.yml up -d
Docker Compose is now in the Docker CLI, try `docker compose up`
Creating network "supergraph-demo_default" with the default driver
Creating users ... done
Creating products ... done
Creating inventory ... done
Creating router ... done
Starting Apollo Gateway in managed mode ...
Apollo usage reporting starting! See your graph at https://studio.apollographql.com/graph/supergraph-test@dev/
🚀 Graph Router ready at http://localhost:4000/
-------------------------------------------------------------------------------------------
+ curl -X POST -H 'Content-Type: application/json' --data '{ "query": "{ allProducts { id, sku, createdBy { email, totalProductsCreated } } }" }' http://localhost:4000/
{"data":{"allProducts":[{"id":"apollo-federation","sku":"federation","createdBy":{"email":"[email protected]","totalProductsCreated":1337}},{"id":"apollo-studio","sku":"studio","createdBy":{"email":"[email protected]","totalProductsCreated":1337}}]}}
-------------------------------------------------------------------------------------------
docker-compose down
Stopping router ... done
Stopping products ... done
Stopping inventory ... done
Stopping users ... done
Removing router ... done
Removing products ... done
Removing inventory ... done
Removing users ... done
Removing network supergraph-demo_default
In the end I managed to push the graphs one by one and created the federated graph, but currently, when I make this query, I got product.id was not federated, could you please help on that.
Fixed with the PR above, sorry for the inconvenience! 🙂
from supergraph-demo.
Related Issues (17)
- make query returns an error HOT 2
- `make local` with rover v0.0.10 returns Syntax Error: Cannot parse the unexpected character "\u250C". HOT 1
- Supergraph readme instructions are causing error HOT 1
- When will the apollo gateway be able to consume a supergraph? HOT 6
- add @tag and @inaccessible directive support to the demo
- add open telemetry support to the demo HOT 1
- Open Telemetry in `make k8s-up-dev`
- Should we expect a subgraph to have multiple "entities" as a common approach? HOT 1
- Dependency Dashboard
- README not working: subgraph service doesn't start HOT 1
- use demo query that spans multiple subgraphs
- have local subgraph impls that can be loaded into the docker-compose.yml file
- Contracts + Fed 1
- Apollo Federation V2 update HOT 1
- Cannot `make run` if you set `$APOLLO_KEY` to a user API key HOT 1
- add deploy branches to showcase CI/CD HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from supergraph-demo.