Skip to content

ScottVandervort/apollo-react-tutorial

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

303 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Apollo tutorial

This is the fullstack app for the Apollo tutorial. ๐Ÿš€

File structure

The app is split out into two folders:

  • start: Starting point for the tutorial
  • final: Final version

From within the start and final directories, there are two folders (one for server and one for client).

Installation

To run the app, run these commands in two separate terminal windows from the root:

cd final/server && npm i && npm start

and

cd final/client && npm i && npm start

GraphQL Playground

Once the server is running can use the web-based GraphQL Playground to browse the schema and run queries. Graph QL Playground

GraphQL Queries

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.

Tutorials

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().

About

๐Ÿš€ The Apollo platform tutorial app

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 68.2%
  • TypeScript 29.9%
  • HTML 1.9%