npx skills add ...
npx skills add apollographql/skills --skill apollo-connectors
npx skills add apollographql/skills --skill apollo-connectors
Guide for integrating REST APIs into GraphQL supergraphs using Apollo Connectors with @source and @connect directives. Use this skill when the user: (1) mentions "connectors", "Apollo Connectors", or "REST Connector", (2) wants to integrate a REST API into GraphQL, (3) references @source or @connect directives, (4) works with files containing "# Note to AI Friends: This is an Apollo Connectors schema".
If GraphOS MCP Tools are available, use them:
Documentation paths by topic:
/graphos/connectors/requests/url, /headers, /body, /batching/graphos/connectors/responses/fields, /error-handling/graphos/connectors/mapping, /arrays, /enums, /literals/graphos/connectors/entities, /patternsFollow this 5-step process. DO NOT skip any steps.
rover supergraph compose --config ./supergraph.yamlrover connector run --schema <file> -c "<Type.field>" -v "{}"/tests/rover connector testVersion Requirements: Always use federation/v2.12 and connect/v0.3 unless specified otherwise.
Before implementing connectors, read the relevant reference files:
->map for cleaner mappings$ when selecting fields directly from rootnewName: originalField (only when renaming)fieldName { ... } (to map nested content)@connect on a type to make it an entity (no @key needed)user: { id: userId }productId), create an entity relationship@connectUse $() wrapper for literal values in mappings:
Convert N+1 patterns using $batch:
--elv2-license accept (for humans only)rover supergraph compose after changes$env over $config for environment variablesrover dev for running Apollo Router locally# DO - Direct sub-selection for arrays
$.results {
firstName: name.first
lastName: name.last
}
# DO NOT - Unnecessary root $
$ {
id
name
}
# DO - Direct field selection
id
name$(1) # number
$(true) # boolean
$("hello") # string
$({"a": "b"}) # object
# In body
body: "$({ a: $args.a })" # CORRECT
body: "{ a: $args.a }" # WRONG - will not composehttp: {
GET: "/api"
headers: [
{ name: "Authorization", value: "Bearer {$env.API_KEY}" },
{ name: "X-Forwarded", from: "x-client" }
]
}type Product @connect(
source: "api"
http: {
POST: "/batch"
body: "ids: $batch.id"
}
selection: "id name"
) {
id: ID!
name: String
}