Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

README.md

Grafbase ⨯ Mutation Resolvers

This example shows how to create a new mutation that is added to your Grafbase GraphQL API — Read the guide

Getting Started

  1. Run npx degit grafbase/grafbase/examples/resolvers-mutation grafbase-with-resolvers-mutation to clone this example
  2. Change directory into the new folder cd grafbase-with-resolvers-mutation
  3. Run cp grafbase/.env.example grafbase/.env
  4. Open grafbase/.env in your code editor and provide your Stripe Secret Key
  5. Run npx grafbase dev to start local dev server with your schema
  6. Visit http://localhost:4000
  7. Add a product and price via the Stripe Dashboard
  8. Create a new Stripe Checkout Session for the Product/Price created above:
mutation {
  checkout(input: {
    lineItems: [
      {
        price: 'price_1Mt5h0D1CEk8AY6BaIVyRJRN',
        quantity: 1
      }
    ]
  }) {
    url
  }
}