0.0.3 • Published 4 years ago

joeygql v0.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

joeygql

Gitter

npm version Build Status Dependency Status FOSSA Status GitHub license

This is used as a additional supportive library above hasura-graphql-engine (open-source)

Documentation

  • Deploy hasura server

  • Then make a table (postgres)

    CREATE TABLE public.user_auth (
    	id serial NOT NULL,
    	h_id text NOT NULL,
    	auth_token text NOT NULL,
    	"role" text NOT NULL DEFAULT 'user'::text,
    	CONSTRAINT user_auth_auth_token_key UNIQUE (auth_token),
    	CONSTRAINT user_auth_h_id_key UNIQUE (h_id),
    	CONSTRAINT user_auth_id_key UNIQUE (id),
    	CONSTRAINT user_auth_pkey PRIMARY KEY (id, h_id)
    );
* metadata.json (hasura)
```json
{"functions":[],"remote_schemas":[],"query_collections":[],"allowlist":[],"tables":[{"table":"user_auth","object_relationships":[],"array_relationships":[],"insert_permissions":[{"role":"google","comment":null,"permission":{"set":{},"check":{},"columns":["auth_token","h_id","role"]}}],"select_permissions":[{"role":"google","comment":null,"permission":{"allow_aggregations":false,"columns":["auth_token","h_id","id","role"],"filter":{"h_id":{"_eq":"X-HASURA-USER-H-ID"}}}}],"update_permissions":[{"role":"google","comment":null,"permission":{"set":{},"columns":["auth_token","role"],"filter":{"h_id":{"_eq":"X-HASURA-USER-H-ID"}}}}],"delete_permissions":[],"event_triggers":[]}],"query_templates":[]}
  • Install
npm -i joeyql
  • Import module
const joeygql = require('joeygql');
  • Set hasura graphql url
joeygql.setHasuraGraphqlUrl("<HASURA_GRAPHQL_URL>","<HASURA_GRAPHQL_ACCESS_KEY>");
  • Set hasura graphql url
joeygql.setHasuraGraphqlUrl("<HASURA_GRAPHQL_URL>","<HASURA_GRAPHQL_ACCESS_KEY>");
joeygql.setGoogleApiClientId("<GOGGLE_CLIENT_ID>");
joeygql.setCloudinaryUrl("<CLOUDINARY_API_ID>")
  • If you are using express then this is how you use sign in
router.post('/sign_in', function (req, res, next) {
    joeygql.signInGoogle(req.body.id_token).then(data => res.json(data)).catch(e => res.json(e));
});

Changelog

Contributing Open Source Helpers CLA assistant

We're looking for co-maintainers! If you want to become a master of time please write to joeydash.

In addition to contributing code, you can help to triage issues. This can include reproducing bug reports, or asking for vital information such as version numbers or reproduction instructions. If you would like to start triaging issues, one easy way to get started is to subscribe to moment/moment on CodeTriage.

License

Moment.js is freely distributable under the terms of the MIT license.

FOSSA Status

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago

2.2.0

5 years ago

2.1.0

5 years ago

2.0.10

5 years ago

2.0.9

5 years ago

2.0.8

5 years ago

2.0.6

5 years ago

2.0.5

5 years ago

2.0.4

5 years ago

2.0.3

5 years ago

2.0.2

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago