This example shows how to create a new query that is added to your Grafbase GraphQL API — Read the guide
- Run
npx degit grafbase/grafbase/examples/resolvers-query grafbase-with-resolvers-queryto clone this example - Change directory into the new folder
cd grafbase-with-resolvers-query - Run
cp grafbase/.env.example grafbase/.env - Open
grafbase/.envin your code editor and provide your OpenAI API Key - Run
npx grafbase devto start local dev server with your schema - Visit http://localhost:4000
- Ask OpenAI a question using GraphQL:
{
ask(prompt: "Who invented GraphQL?") {
text
}
}