Giter Club home page Giter Club logo

todo-app-graphql-engine-auth0's Introduction

Important: This repo has been moved to hasura/graphql-engine

The contents of this repo have been moved to hasura/graphql-engine. Please create all issues and pull requests there.


Todo app using Hasura GraphQL Engine, Heroku Postgres and Auth0

  • STEP 1: Set auth0 domain

    Set your auth0 domain in auth-webhook/constants.js. Also allow callbacks for http://localhost:3000/callback in your auth0 dashboard.

  • STEP 2: Deploy the auth Webhook (using ngrok, glitch, heroku or whatever)

    glitch-deploy-button

  • STEP 3: Start GraphQL engine with the the auth-hook as the webhook URL and access key of your choice

    Deploy GraphQL engine to Heroku if you do not have it deployed anywhere.

    Deploy to heroku

  • STEP 4: Apply the migrations

    • Add your database URL and access key in hasura-graphql-engine/config.yaml
    • Run hasura migrate apply to create the required tables and permissions for the todo app
  • Step 5: Set React app variables

    Set auth0 domain, auth0 client ID and the GraphQL Engine URL in todo-app/src/constants.js

  • Step 6: Run the React app

    Run npm start from the todo-app directory to start the TODO app.

    THe app runs on port 3000 by default. You can change the port number, but you will also have to reconfigure the callback

todo-app-graphql-engine-auth0's People

Contributors

wawhal avatar coco98 avatar

Stargazers

Hone Watson avatar Anton Dvorson avatar Nat Welch avatar  avatar Darshil Chanpura avatar Christian von Hassell avatar Josh White avatar Arpit Kushwaha avatar <Explorer /> avatar  avatar

Watchers

James Cloos avatar

todo-app-graphql-engine-auth0's Issues

Refer X-Hasura-User-Id in GraphQL mutations?

Consider this request payload when creating a todo.

{"operationName":"insert_todo","variables":{"objects":[{"task":"test-todo5","user_id":"auth0|5b721527280d8b73e2721281","completed":false}]},"query":"mutation insert_todo($objects: [todo_insert_input!]) {\n insert_todo(objects: $objects) {\n affected_rows\n returning {\n id\n task\n completed\n }\n }\n}\n"}

Is there a way to substitute the user_id field in a graphql mutation with a Hasura header value on the server side? Ideally with the X-Hasura-User-Id header that already has the same information(https://docs.hasura.io/1.0/graphql/manual/auth/index.html).

I am looking to avoid sending any more authentication/authorization information than I need to.

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.