(Text covers the exact same content as the video)
Practice
@source
directive@source
directive takes in a few parameters to help us define a shared data source for multiple Connectors. The name
parameter is a Drag items from this box to the blanks above
Connector
http.baseURL
http.restAPI
http.headers
http.restHeaders
unique identifier
headers
Define a @source
named outerspace
that points to the URL http://outerspace-api.example/
. Include a header named x-caller
with a hard-coded value of space-schema
. Review the previous lesson for a refresher on the @source
parameters and how to include headers.
Key takeaways
- The
@source
directive defines a shared data source for multiple Connectors. - The
@source
directive takes in two parameters:name
andhttp
.
Up next
There's one thing we're missing from our schema: the endpoint we should connect to. Let's fix this build error in the next lesson!
Share your questions and comments about this lesson
Your feedback helps us improve! If you're stuck or confused, let us know and we'll help you out. All comments are public and must follow the Apollo Code of Conduct. Note that comments that have been resolved or addressed may be removed.
You'll need a GitHub account to post below. Don't have one? Post in our Odyssey forum instead.