fixing env vars issue

This commit is contained in:
Samuel Andert
2023-08-25 12:31:15 +02:00
parent 8d4b217c99
commit 3ab9976ce8
7 changed files with 70 additions and 51 deletions

7
src/lib/Login.svelte Normal file
View File

@ -0,0 +1,7 @@
<script>
async function login() {
alert("login");
}
</script>
<button on:click={login}>Login</button>

View File

@ -1,5 +1,21 @@
<script>
import GraphQL from "./GraphQL.svelte";
<script lang="ts">
import { createQuery } from "../lib/wundergraph";
import Login from "$lib/Login.svelte";
const projectsQuery = createQuery({
operationName: "Projects",
});
</script>
<GraphQL />
<Login />
<br />
Projects
<div class="results">
{#if $projectsQuery.isLoading}
<p>Loading...</p>
{:else if $projectsQuery.error}
<pre>Error: {JSON.stringify($projectsQuery.error, null, 2)}</pre>
{:else}
<pre>{JSON.stringify($projectsQuery.data, null, 2)}</pre>
{/if}
</div>

View File

@ -1,46 +0,0 @@
<script lang="ts">
import { createQuery } from "../lib/wundergraph";
// const dragonsQuery = createQuery({
// operationName: "Dragons",
// });
const projectsQuery = createQuery({
operationName: "Projects",
});
const todosQuery = createQuery({
operationName: "Todos",
});
</script>
<!-- Dragons
<div class="results">
{#if $dragonsQuery.isLoading}
<p>Loading...</p>
{:else if $dragonsQuery.error}
<pre>Error: {JSON.stringify($dragonsQuery.error, null, 2)}</pre>
{:else}
<pre>{JSON.stringify($dragonsQuery.data, null, 2)}</pre>
{/if}
</div> -->
Projects
<div class="results">
{#if $projectsQuery.isLoading}
<p>Loading...</p>
{:else if $projectsQuery.error}
<pre>Error: {JSON.stringify($projectsQuery.error, null, 2)}</pre>
{:else}
<pre>{JSON.stringify($projectsQuery.data, null, 2)}</pre>
{/if}
</div>
Todos
<div class="results">
{#if $todosQuery.isLoading}
<p>Loading...</p>
{:else if $todosQuery.error}
<pre>Error: {JSON.stringify($todosQuery.error, null, 2)}</pre>
{:else}
<pre>{JSON.stringify($todosQuery.data, null, 2)}</pre>
{/if}
</div>