Removing Prisma and Grapql-nestjs-prisma resolvers (#2574)

* Some cleaning

* Fix seeds

* Fix all sign in, sign up flow and apiKey optimistic rendering

* Fix
This commit is contained in:
Charles Bochet
2023-11-19 18:25:47 +01:00
committed by GitHub
parent 18dac1a2b6
commit f5e1d7825a
616 changed files with 2220 additions and 23073 deletions

View File

@ -1,9 +0,0 @@
import { gql } from '@apollo/client';
export const DELETE_ONE_API_KEY = gql`
mutation DeleteOneApiKey($apiKeyId: String!) {
revokeOneApiKey(where: { id: $apiKeyId }) {
id
}
}
`;

View File

@ -1,9 +0,0 @@
import { gql } from '@apollo/client';
export const GENERATE_ONE_API_KEY_TOKEN = gql`
mutation GenerateOneApiKeyToken($data: ApiKeyCreateInput!) {
generateApiKeyV2Token(data: $data) {
token
}
}
`;

View File

@ -1,13 +0,0 @@
import { gql } from '@apollo/client';
export const INSERT_ONE_API_KEY = gql`
mutation InsertOneApiKey($data: ApiKeyCreateInput!) {
createOneApiKey(data: $data) {
id
name
token
createdAt
expiresAt
}
}
`;

View File

@ -1,12 +0,0 @@
import { gql } from '@apollo/client';
export const GET_API_KEY = gql`
query GetApiKey($apiKeyId: String!) {
findManyApiKey(where: { id: { equals: $apiKeyId } }) {
id
name
expiresAt
createdAt
}
}
`;

View File

@ -1,12 +0,0 @@
import { gql } from '@apollo/client';
export const GET_API_KEYS = gql`
query GetApiKeys {
findManyApiKey {
id
name
expiresAt
createdAt
}
}
`;

View File

@ -1,17 +0,0 @@
import { GET_API_KEYS } from '@/settings/developers/graphql/queries/getApiKeys';
import { ApiKey } from '~/generated/graphql';
export const getApiKeysOptimisticEffectDefinition = {
key: 'generic-entity-table-data-api-keys',
typename: 'ApiKey',
query: GET_API_KEYS,
resolver: ({
currentData,
newData,
}: {
currentData: ApiKey[];
newData: ApiKey[];
}) => {
return [...newData, ...currentData];
},
};

View File

@ -0,0 +1,8 @@
export type ApiKey = {
id: string;
createdAt: string;
updatedAt: string;
deletedAt: string | null;
name: string;
expiresAt: string;
};

View File

@ -1,5 +1,5 @@
import { ApiFieldItem } from '@/settings/developers/types/ApiFieldItem';
import { ApiKey } from '~/generated/graphql';
import { ApiKey } from '@/settings/developers/types/ApiKey';
import { beautifyDateDiff } from '~/utils/date-utils';
export const formatExpiration = (