Git Product home page Git Product logo

graphql-example-apps's Introduction

example-apps

How to use:

  1. Create your heroku app without an access-key
  2. Initialize directory for Hasura GraphQL Engine
hasura init <app-name>
  1. cd into and edit config.yaml to update the endpoint
  2. Run pg_dump to dump the required schemas
pg_dump -h host -d database -U user --attribute-inserts -n schema1,schema2 > migrations/1_init.up.sql
  1. Export metadata by running:
hasura metadata export
  1. Commit all your changes and push to git.
  2. Add [email protected] as collaborator (Important)
heroku access:add [email protected] --app <app-name>

Buildbot Workflow (this will happen automatically every 30mins):

  1. Clone the examples-apps repo
  2. Reset postgresql database by running:
heroku pg:reset --app <app-name> --confirm <app-name>
  1. Restart the app so that graphql-engine is initialized
heroku restart --app <app-name>
  1. Apply the migrations by running:
hasura migrate apply
  1. Apply the metadata by running:
hasura metadata apply

Optional files:

  • A README that describes your app
  • A queries.graphql file that lists your sample GraphQL queries that GraphiQL will automatically be loaded with
# Insert author
mutation {
  insert_author(objects: [{name: "natwarlal"}] {
    returning {
      id
    }
  }
}

# Query author
query {
  author {
    id
    name
  }
}

What is the point?

  • A script will refresh all the databases every 30mins for all the example apps (it will run the migrations in the migrations directory)
  • This way you can safely share the Hasura GraphQL engine link with whoever and put it wherever you want, like in your blogpost or on the Hasura website or in a forum or on quora

graphql-example-apps's People

Contributors

arvi3411301 avatar coco98 avatar paranoidsp avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.