apollographql / apollo-tooling

✏️ Apollo CLI for client tooling (Mostly replaced by Rover)
https://apollographql.com
MIT License
3.04k stars 468 forks source link

Whitelisting issue while following the apollo documentation #1898

Open SamierMahagna opened 4 years ago

SamierMahagna commented 4 years ago

Hello, I am attempting to follow the following document to whitelist queries for my application:

https://www.apollographql.com/docs/graph-manager/operation-registry/#1-install-the-apollo-command-line-tool I run my server locally and get the following:

[WARN] Wed Apr 15 2020 15:50:38 GMT-0700 (Pacific Daylight Time) apollo-server:apollo-server-plugin-operation-registry No manifest found for tag "current" at **.json. Ensure this server's schema has been published with 'apollo service:push' and that operations have been registered with 'apollo client:push'.

So I attempted to push my service and did the following: C02TP30CHTD5% npx apollo service:push \ --key \ --endpoint http://localhost:4000 › Warning: apollo update available from 2.25.0 to 2.27.0. ✔ Loading Apollo Project ✔ Uploading service to Apollo Graph Manager

╔════════╤════════════════════════════╤═════════╗ ║ id │ graph │ tag ║ ╟────────┼────────────────────────────┼─────────╢ ║ 0792c1 │ **-graphql-server-dev │ current ║

Since I was still receiving the error I then attempted to push the client:

C02TP30CHTD5% npx apollo client:push \ --key s= \ --clientName current \ --clientVersion 0.01 \ --includes="/src/typedefs/sam-typedef.{ts,js,graphql}"

› Warning: apollo update available from 2.25.0 to 2.27.0. ⠋ Loading Apollo Project Extracting operation from client, current@0.01 Checked operations against -graphql-server-dev@current Pushing operations to operation registry CLIError: Error in "Loading schema for -graphql-server-dev": Error: Type "Query" already exists in the schema. It cannot also be defined in this type definition.

Field "Query.sam2PublicProfile" already exists in the schema. It cannot also be defined in this type extension. at Object.error ... ... ... ... deleted lines → Field "Query.sam2PublicProfile" already exists in the schema. It cannot also be defined in this type extension.

I am just trying to see if I can approve some queries, the parameters they require and set this up for my production pipeline. I do not understand what I am missing from the documentation.

SamierMahagna commented 4 years ago

Could someone please provide an example of what files I am suppose to push for client:push. I have a suspicion that I am providing the wrong files.