1m
What are Apollo Connectors?
Apollo Connectors let you connect to existing REST services from the schema.
The @source directive
@source defines a reusable configuration for multiple connectors.
Example of @source in action
@source(name: "verycoolapi"http: {baseURL:"https://rest-api.com"headers: [{ name: "x-api-key", from: "x-api-key"}{ name: "x-caller", value: "apollo" }]})
Which of the following can you configure in the
@source directive?The @connect directive
@connect describes how to get the data for a GraphQL field from a REST endpoint. Each instance of @connect is a "connector."
Example of @connect in action
@connect(source: "verycoolapi"http: {GET: "/endpoint"headers: [{ name: "x-api-key", from: "x-api-key" }]}selection: """idname: full_name""")
Which of the following
@connect directive parameters should you use to map the endpoint's specific JSON properties to your GraphQL schema?