Skip to content

alexedev/graphqleu-2018-ws

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🇪🇺 GraphQL Europe Workshop - GraphQL Bindings 🇪🇺

Demo 1

Used commands

Install Prisma globally

npm install -g prisma
# OR
yarn global add prisma

Initialize Prisma server

prisma init your-project-name

Note: Select Demo server and register with Prisma Cloud (e.g. using your GitHub account)

Deploy Prisma service

cd your-project-name
prisma deploy

Note: Do it each time you update the schema for now (we will add a post-deploy hook later )

Play with Prisma API (send some queries)

prisma playground

Steps (check out if you get lost)

  1. Prisma initiated with default data model

    git checkout v0
  2. Data model updated with Post type

    git checkout v1

Demo 2

Used commands

For fetch example:

yarn init -y
yarn add node-fetch

Install Prisma bindings

yarn add prisma-binding graphql

Install graphq-cli to download Prisma's auto-generated GraphQL schema

yarn global add graphql-cli

Get remote schema (after adding .graphqlconfig.yml)

graphql get-schema

Steps (check out if you get lost)

  1. Example of calling prisma gql queries with fetch

    git checkout v1.1
  2. Clean up before adding Prisma bindings

    git checkout v2
  3. Instantiate Prisma bindings

    git checkout v2.1
  4. Add Prisma bindings example

    git checkout v2.2