referenced to Prisma GraphQL API Page
-
$ npm install -g prisma
-
$ prisma init
- choose you want to configure (to local/to remote)
- choose what database do you want to configure
-
$ docker-compose up -d
-
$ prisma deploy
-
$ prisma playground
- Queries
- Mutations
- Subscriptions
If you want to really test that node API, you have to set the default datamodel in basic prisma tutorial here.
You can get prisma token $ prisma token
- fetch
$ node api/api_fetch.js [username] [email] [post(single node)] [prisma token] ex) node api/api_fetch.js prismaTest [email protected] '{"title":"hello prisma!", "published":false}' [prisma token]
- graphql-client
$ node api/api_graphql-client.js [username] [email] [post(single node)] [prisma token] ex) node api/api_fetch.js prismaTest [email protected] '{"title":"hello prisma!", "published":false}' [prisma token]
- graphql-request
graphql-request
does not support passing headers to the request yet- so if you want to test, delete
secret:
property inprisma.yml
and restart prisma.
$ node api/api_graphql-request.js [username] [email] [post(single node)] ex) node api/api_fetch.js prismaTest [email protected] '{"title":"hello prisma!", "published":false}'
- apollo
- test failed.
server
⌙ prisma.yml
⌙> generated/prisma-study.graphql
⌙ api
⌙ prisma_subscription.js
⌙ api_fetch_temp.js
client
⌙ src/index.js
⌙ src/App.js
- https://github.com/apollographql/subscriptions-transport-ws
- https://hackernoon.com/real-time-react-app-with-graphql-websocket-fe64f42e97bc
- https://github.com/apollographql/react-apollo
- https://github.com/apollographql/graphql-subscriptions
Could not connect to websocket endpoint ws://localhost:4466. Please check if the endpoint url is correct.