This example shows how to create a new mutation that is added to your Grafbase GraphQL API — Read the guide
- Run
npx degit grafbase/grafbase/examples/resolvers-mutation grafbase-with-resolvers-mutationto clone this example - Change directory into the new folder
cd grafbase-with-resolvers-mutation - Run
cp grafbase/.env.example grafbase/.env - Open
grafbase/.envin your code editor and provide your Stripe Secret Key - Run
npx grafbase devto start local dev server with your schema - Visit http://localhost:4000
- Add a product and price via the Stripe Dashboard
- Create a new Stripe Checkout Session for the Product/Price created above:
mutation {
checkout(input: {
lineItems: [
{
price: 'price_1Mt5h0D1CEk8AY6BaIVyRJRN',
quantity: 1
}
]
}) {
url
}
}