hasura-casing-layer
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Hasura Casing Layer

schema builder for adding naming convention transformation layer in front of hasura

Installation

npm install hasura-casing-layer graphql @graphql-tools/wrap

Usage

Express

import express from "express";
import { transformRemoteSchema } from "hasura-casing-layer";
import { graphqlHTTP } from "express-graphql";
import { buildSchema } from "graphql";

const app = express();

const runServer = async () => {
  const hasuraSchema = await transformRemoteSchema({
    uri: "https://yourhasuraendpoint.com",
    // used for instrospection
    hasuraAdminSecret: "supersecret",
  });

  app.use(
    "/graphql",
    graphqlHTTP({
      schema: hasuraSchema,
      graphiql: true,
    })
  );

  app.listen(4000, () => {
    console.log("listeing at localhost:4000 🐐☁");
  });
};

runServer();

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i hasura-casing-layer

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

31.8 kB

Total Files

5

Last publish

Collaborators

  • adeyahya