sveltekit-graphql-codegen-apollo Svelte Themes

Sveltekit Graphql Codegen Apollo

sveltekit-graphql-codegen-apollo

Tested with Apollo 3.5.6 - that version and upgrades can break compatibility. Once we have that working then let's test any newer version which might be currently available.

  1. npm i -D @apollo/[email protected] dotenv [email protected] graphql-tag node-fetch svelte-preprocess
  2. Rename .env.exmple to .env and add your endpoint and, for example, Hasura x-hasura-admin-secret
  3. Create src/lib/utilities/apolloClient.js and update line 26 for the right authorisation
  4. Patch the Apollo client ./patch-apollo-client.sh
  5. Integrate the patch into the build script to run when the host builds the site: Update the build script in the package.json
  6. Use the Apollo client src/routes/+page.server.js

Top categories

Loading Svelte Themes