0.0.0-alpha.5 • Published 7 months ago

gqlpt v0.0.0-alpha.5

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

gqlpt

GQLPT leverages the power of ChatGPT to generate GraphQL queries from plain text.

Live playground: https://gqlpt.dev/

Installation

https://www.npmjs.com/package/gqlpt

npm install gqlpt

Usage

import { GQLPTClient } from "gqlpt";

const typeDefs = `
    type User {
        id: ID!
        name: String!
        email: String!
    }

    type Query {
        users(name: String): [User!]!
    }
`;

const gqlpt = new GQLPTClient({
  apiKey: "chatgpt-api-key",
  typeDefs,
});

await gqlpt.connect();

const response = await gqlpt.generate("Get all users where name is dan");

/*
    query {
        users(where: { name: "dan" }) {
            id
            name
            email
        }
    }
*/

License

MIT - Dan Starns - danielstarns@hotmail.com

0.0.0-alpha.5

7 months ago

0.0.0-alpha.3

12 months ago

0.0.0-alpha.4

12 months ago

0.0.0-alpha.2

1 year ago

0.0.0-alpha.1

1 year ago

0.0.0-alpha.0

1 year ago