Coder Social home page Coder Social logo

Comments (1)

prasek avatar prasek commented on May 18, 2024

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!

image

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.