- graph, dotenv read
- graph, cors and secure header - web, urql client basic setup
This commit is contained in:
9
web/lib/gql/auth.gql.ts
Normal file
9
web/lib/gql/auth.gql.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { gql } from '@urql/svelte';
|
||||
export const Me = gql`
|
||||
query Me {
|
||||
me {
|
||||
id
|
||||
displayName
|
||||
}
|
||||
}
|
||||
`;
|
@@ -3,6 +3,6 @@ import { Client, cacheExchange, fetchExchange } from '@urql/svelte';
|
||||
export function newClient(url: string) {
|
||||
return new Client({
|
||||
url,
|
||||
exchanges: [cacheExchange, fetchExchange]
|
||||
exchanges: [ fetchExchange]
|
||||
});
|
||||
}
|
51
web/lib/gql/graph.d.ts
vendored
Normal file
51
web/lib/gql/graph.d.ts
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
export type Maybe<T> = T | null;
|
||||
export type InputMaybe<T> = Maybe<T>;
|
||||
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
|
||||
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
|
||||
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
|
||||
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
|
||||
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
|
||||
/** All built-in and custom scalars, mapped to their actual values */
|
||||
export type Scalars = {
|
||||
ID: { input: string; output: string; }
|
||||
String: { input: string; output: string; }
|
||||
Boolean: { input: boolean; output: boolean; }
|
||||
Int: { input: number; output: number; }
|
||||
Float: { input: number; output: number; }
|
||||
Any: { input: any; output: any; }
|
||||
Map: { input: any; output: any; }
|
||||
Time: { input: any; output: any; }
|
||||
Void: { input: any; output: any; }
|
||||
};
|
||||
|
||||
export type AuthUser = {
|
||||
__typename?: 'AuthUser';
|
||||
displayName: Scalars['String']['output'];
|
||||
email: Scalars['String']['output'];
|
||||
id: Scalars['ID']['output'];
|
||||
roleID: Scalars['Int']['output'];
|
||||
};
|
||||
|
||||
export type Mutation = {
|
||||
__typename?: 'Mutation';
|
||||
login: Scalars['Boolean']['output'];
|
||||
logout: Scalars['Boolean']['output'];
|
||||
};
|
||||
|
||||
|
||||
export type MutationLoginArgs = {
|
||||
email: Scalars['String']['input'];
|
||||
username: Scalars['String']['input'];
|
||||
};
|
||||
|
||||
export type Query = {
|
||||
__typename?: 'Query';
|
||||
heartBeat: Scalars['Boolean']['output'];
|
||||
/** me, is current AuthUser info */
|
||||
me?: Maybe<AuthUser>;
|
||||
};
|
||||
|
||||
export type MeQueryVariables = Exact<{ [key: string]: never; }>;
|
||||
|
||||
|
||||
export type MeQuery = { __typename?: 'Query', me?: { __typename?: 'AuthUser', id: string, displayName: string } | null };
|
Reference in New Issue
Block a user