β π§ A GraphQL workshop to learn GraphQL implementations
A GraphQL workshop to learn GraphQL implementations in JavaScript
graphql-with-wordpress
branch )localhost:5000/graphql
) in server.js
.localhost:3000
)schema.js
localhost:5000/graphql
.<Apolloclient>
from apollo-boost
and create a new object called client
and pass the url for our GraphQL endpoint into this object.<AppoloProvider>
and apollo client
is then passed to these components, so that the results of your query can be passed to your components.graphql-tag
( graphQl query parsing utility ) is installed and gpl
is imported from it. The gpl
parses GraphQL query strings into the standard GraphQL AST.gpl
to query the data in front react app, from the schema we have create in our node application in backend.Home.js
).git clone https://github.com/imranhsayed/graphql-workshop
npm install
npm run dev
localhost:5000/graphql
, where you can send all your query request.For graphql-with-wordpress
branch Clone these repositories into plugin directory of your WordPress Install and activate them from WordPress dashboard.
Graphiql
is a tool that we can use as a client to make request to our server.localhost:5000/graphql
You can run these commands from root directory.
npm run dev
runs webpack-dev-server for frontend on port 3000 in watch mode and backend server on port 5000. ( Uses concurrently package to run the two servers together,npm run dev:client
starts webpack dev server for React on port 5000
npm run dev:server
starts nodejs server on port 3000
npm run prod:client
runs the build for production for client.Apollo Client is way to use GraphQL to build client applications. It helps you build a UI that fetches data with GraphQL, and can be used with any JavaScript front-end.
When two components need the same data. If an action triggers an update on update, the second one wonβt be updated . Apollo solves this using reactive cache
feature.
Its main job is fetch some GraphQL queries and keep them in sync with one another
I would like to thank π everyone who attended the GraphQL with React and WordPress Meet up on Sep 21, 2019. The session wouldn't have been so enjoyable and fruitful without your presence.π