feat: Init commit.
This commit is contained in:
6
commons/graphql/client.ts
Normal file
6
commons/graphql/client.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import { ApolloClient, InMemoryCache } from "@apollo/client";
|
||||
|
||||
export const client = new ApolloClient({
|
||||
uri: "/api/graphql",
|
||||
cache: new InMemoryCache(),
|
||||
});
|
79
commons/graphql/generated.tsx
Normal file
79
commons/graphql/generated.tsx
Normal file
@@ -0,0 +1,79 @@
|
||||
import { gql } from '@apollo/client';
|
||||
export type Maybe<T> = T | null;
|
||||
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]> };
|
||||
/** All built-in and custom scalars, mapped to their actual values */
|
||||
export type Scalars = {
|
||||
ID: string;
|
||||
String: string;
|
||||
Boolean: boolean;
|
||||
Int: number;
|
||||
Float: number;
|
||||
/** A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format. */
|
||||
DateTime: any;
|
||||
};
|
||||
|
||||
export type Article = {
|
||||
__typename?: 'Article';
|
||||
id: Scalars['ID'];
|
||||
title: Scalars['String'];
|
||||
content: Scalars['String'];
|
||||
publishedAt?: Maybe<Scalars['DateTime']>;
|
||||
tags: Array<Scalars['String']>;
|
||||
};
|
||||
|
||||
export type CreateArticleInput = {
|
||||
title: Scalars['String'];
|
||||
content: Scalars['String'];
|
||||
publishedAt?: Maybe<Scalars['DateTime']>;
|
||||
tags: Array<Scalars['String']>;
|
||||
};
|
||||
|
||||
|
||||
export type Hello = {
|
||||
__typename?: 'Hello';
|
||||
message: Scalars['String'];
|
||||
};
|
||||
|
||||
export type Mutation = {
|
||||
__typename?: 'Mutation';
|
||||
createArticle: Article;
|
||||
updateArticle: Article;
|
||||
removeArticle: Scalars['Int'];
|
||||
};
|
||||
|
||||
|
||||
export type MutationCreateArticleArgs = {
|
||||
createArticleInput: CreateArticleInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationUpdateArticleArgs = {
|
||||
updateArticleInput: UpdateArticleInput;
|
||||
};
|
||||
|
||||
|
||||
export type MutationRemoveArticleArgs = {
|
||||
id: Scalars['String'];
|
||||
};
|
||||
|
||||
export type Query = {
|
||||
__typename?: 'Query';
|
||||
hello: Hello;
|
||||
articles: Array<Article>;
|
||||
article: Article;
|
||||
};
|
||||
|
||||
|
||||
export type QueryArticleArgs = {
|
||||
id: Scalars['String'];
|
||||
};
|
||||
|
||||
export type UpdateArticleInput = {
|
||||
title?: Maybe<Scalars['String']>;
|
||||
content?: Maybe<Scalars['String']>;
|
||||
publishedAt?: Maybe<Scalars['DateTime']>;
|
||||
tags?: Maybe<Array<Scalars['String']>>;
|
||||
id: Scalars['String'];
|
||||
};
|
Reference in New Issue
Block a user