This is the fullstack app for the Apollo tutorial. ๐
The app is split out into two folders:
start: Starting point for the tutorialfinal: Final version
From within the start and final directories, there are two folders (one for server and one for client).
To run the app, run these commands in two separate terminal windows from the root:
cd final/server && npm i && npm startand
cd final/client && npm i && npm startOnce the server is running can use the web-based GraphQL Playground to browse the schema and run queries. Graph QL Playground
In a GraphQL query the query name ( ex: "GetLaunches" ) is arbitrary, it doesn't correspond to the queries declared in the Schema. "launches", however, DOES correspond to the query declared in the Schema. The stuff in the brackets defines what you want returned. ''' query GetLaunches { launches { id mission { name } } } '''
Variables can be parameterized, too.... ''' query GetLaunchById { launch(id: 60) { id rocket { id type } } }
query GetLaunchById($id: ID!) { launch(id: $id) { id rocket { id type } } } ''' ... this would be how you specify a value for the variable. ''' { "id": 60 } '''
'''
Can specify autorization and other headers in GraphiQL at bottom left of interface.
Redux is unecessary with Apollo; APollo has it's own datastore ( i.e., "Store" ), state, and caching mechanisms.
https://www.apollographql.com/docs/apollo-server/testing/mocking/
https://www.apollographql.com/docs/tutorial/data-source/
Here: https://www.apollographql.com/docs/tutorial/mutation-resolvers/
https://www.apollographql.com/docs/tutorial/queries/ Tomorrow get debugger to work; I want to see what is beging returned in launches.jsx / updateQuery().