Create a .env file on the root folder with a content like the following.
VITE_GRAPHQL_ENDPOINT="http://localhost:4000/graphql"
- This .env file is not commited, and should only be used for local, development variables.
Install the dependencies
npm iRun this command to generate all graphql requests
npm run generateRun the project
npm run dev<script lang="ts">
import { getContextClient, mutationStore } from '@urql/svelte'
import * as gql from '../graphql/generated'
const auth = mutationStore({
client: getContextClient(),
query: gql.SigninDocument,
variables: {
email: 'example@example.com',
password: 'example',
},
})
</script>
<p>{$auth.data}</p>Create a new file inside src/renderer/src/graphql/operations and follow the same structure
Run this command to generate the graphql requests
npm run generate