https://www.npmjs.com/package/gqlpt
npm install gqlpt
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(name: "dan") {
id
name
email
}
}
*/
- I'm seeing the error "429 - Rate limit reached for requests" on making requests.
This error is related to sending too many requests to OpenAI, and them trying to rate-limit you. Try limiting the requests to gqlpt, or upgrading to a paid OpenAI API plan. In case of persistent errors, create an issue with us, or reach out to OpenAI support for OpenAI related errors.
MIT - Rocket Connect - https://github.com/rocket-connect