This is a Apollo, Meteor and React example app.
It is the backend application for this chatbot: ok Chatbot
Blog post: Graphql with Apollo, Meteor and React
The application:
The magic:
- Build system > Meteor
- Graphql client > React and Apollo
- Graphql server > Express and Apollo
Run with:
- Install Meteor
- Clone this repo and install dependencies with
npm install
- Copy
configuration-template.json
todevelopment.json
and update it - Run with
npm run dev
What you get:
- Graphql api running on http://localhost:3000/graphql
- Graphql query editor on: http://localhost:3000/graphiql
- React client app on: http://localhost:3000
Why Meteor as a build system?
Ever tried to run a client and server app with node, babel, webpack and live reload in a development environment? Seppuku!
A list of Graphql queries and mutators.
{
deals {
id
title
imageUrl
pointOfSale
description
expiresAt
createdAt
}
}
mutation {
createDeal(title: "Energy Drink Test") {
id
}
}
mutation {
createDeal(title: "Energy Drink Test", description: "2 für 8", productDetails: "250 ml", itemUrl: "http://www.okpunktstrich.ch/de/", imageUrl: "https://s3.amazonaws.com/valora/energy+drink+resealable.jpg", qrImageUrl: "https://s3.amazonaws.com/valora/energy+drink+qr.png", pointOfSale: ["KKiosk", "Avec"], categoryId: "", publishAt: "2016-09-28T22:11:53.158Z", expiresAt: "2016-10-28T22:11:53.158Z", createdAt: "2016-09-28T22:11:53.158Z") {
id
}
}
mutation {
updateDeal(id: "57ed95d231155e0ba0eab8a3", title: "new title")
}
mutation {
deleteDeal(id: "57ec46867c590b11c8d03100")
}
mutation{
createCategory(label: "Hello World") {
id
}
}
mutation {
updateCategory(id: "57ed90f030387b0a0c2d2448", label: "New Title")
}
mutation {
deleteCategory(id: "57ed90f030387b0a0c2d2448")
}