@@ -15,6 +15,7 @@ A skill for managing GraphQL endpoints and executing operations using `graphql-c
1515## Capabilities
1616
1717- Add and manage multiple GraphQL endpoints (remote URL or local schema file)
18+ - Update existing endpoint URL, headers, or description
1819- Authenticate with endpoints (Bearer token, Basic auth, custom header)
1920- Execute GraphQL queries and mutations
2021- Explore and search GraphQL schemas by keyword
@@ -54,36 +55,42 @@ graphql-cli add production --url https://api.example.com/graphql --description "
5455graphql-cli add local --schema-file ./testdata/schema.graphql --description " Local schema"
5556```
5657
57- ### 2. List endpoints
58+ ### 2. Update an endpoint
59+
60+ ``` bash
61+ graphql-cli update < name> --url < new-url> [--description " desc" ] [--header " Key=Value" ]
62+ ```
63+
64+ Example:
65+ ``` bash
66+ graphql-cli update production --url https://api.example.com/v2/graphql
67+ graphql-cli update production --header " Authorization=Bearer new-token" -d " Updated prod API"
68+ ```
69+
70+ Headers are merged — existing headers not specified in the update are preserved.
71+
72+ ### 3. List endpoints
5873
5974``` bash
6075graphql-cli list # names and URLs
6176graphql-cli list --detail # includes headers (masked) and auth status
6277```
6378
64- ### 3 . Authenticate
79+ ### 4 . Authenticate
6580
6681``` bash
67- # Interactive (prompts for auth type and credentials)
68- graphql-cli login < endpoint>
69-
70- # Non-interactive
7182graphql-cli login < endpoint> --type token --token " my-api-key"
7283graphql-cli login < endpoint> --type basic --user admin --pass secret
7384graphql-cli login < endpoint> --type header --key X-API-Key --value " key123"
85+ graphql-cli login -e production --type token --token " my-token"
7486
7587# Remove credentials
7688graphql-cli logout < endpoint>
7789```
7890
7991Credentials are stored in the OS keyring (macOS Keychain, Windows Credential Manager, GNOME Keyring) with a plaintext file fallback.
8092
81- You can also specify the endpoint via ` -e ` :
82- ``` bash
83- graphql-cli login -e production --type token --token " my-token"
84- ```
85-
86- ### 4. Execute a query
93+ ### 5. Execute a query
8794
8895``` bash
8996graphql-cli query ' <graphql-query>' -e < endpoint>
@@ -92,20 +99,28 @@ graphql-cli query '{ user(id: "1") { name } }' -e <endpoint> -v '{"id": "1"}'
9299graphql-cli query ' { me { name } }' -e < endpoint> -H " Authorization=Bearer token"
93100```
94101
95- ### 5 . Execute a mutation
102+ ### 6 . Execute a mutation
96103
97104``` bash
98105graphql-cli mutate ' <graphql-mutation>' -e < endpoint>
99106graphql-cli mutate -f mutation.graphql -e < endpoint> -v ' {"name": "test"}'
100107graphql-cli mutate ' mutation { createUser(name: "test") { id } }' -e < endpoint>
101108```
102109
103- ### 6 . Explore the schema
110+ ### 7 . Explore the schema
104111
105112``` bash
106- # Search all definitions
113+ # Search all definitions (names only by default)
107114graphql-cli find < keyword> -e < endpoint>
108115
116+ # Keyword supports glob syntax (*, ?, [...])
117+ # Without glob characters, matches as substring
118+ graphql-cli find " get*" -e < endpoint>
119+ graphql-cli find " User?" -e < endpoint>
120+
121+ # Show full definitions with fields and arguments
122+ graphql-cli find < keyword> -e < endpoint> --detail
123+
109124# Narrow by kind
110125graphql-cli find user -e < endpoint> --query # Query fields only
111126graphql-cli find user -e < endpoint> --mutation # Mutation fields only
@@ -144,12 +159,19 @@ graphql-cli query '{ users { id name } }' -e prod 2>/dev/null | jq '.users[0]'
144159
145160### Explore before querying
146161``` bash
147- # First, find what queries are available
162+ # First, find what queries are available (names only)
148163graphql-cli find -e prod --query
149164
150- # Then find the input types needed
151- graphql-cli find CreateUser -e prod --input
165+ # Then use --detail to see full definitions with fields and arguments
166+ graphql-cli find user -e prod --query --detail
167+
168+ # Find the input types needed
169+ graphql-cli find CreateUser -e prod --input --detail
152170
153171# Then execute
154172graphql-cli mutate ' mutation { createUser(input: {name: "Alice", email: "alice@example.com"}) { id } }' -e prod
155- ```
173+ ```
174+
175+ ## Guidelines
176+
177+ - ** Always use ` find ` without ` --detail ` first** to get an overview of matching names, then use ` find --detail ` on specific results to see full definitions with fields and arguments. This avoids overwhelming output when schemas are large.
0 commit comments