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:
@ -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
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -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
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -1,12 +0,0 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const GET_API_KEYS = gql`
|
||||
query GetApiKeys {
|
||||
findManyApiKey {
|
||||
id
|
||||
name
|
||||
expiresAt
|
||||
createdAt
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -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];
|
||||
},
|
||||
};
|
||||
8
front/src/modules/settings/developers/types/ApiKey.ts
Normal file
8
front/src/modules/settings/developers/types/ApiKey.ts
Normal file
@ -0,0 +1,8 @@
|
||||
export type ApiKey = {
|
||||
id: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
deletedAt: string | null;
|
||||
name: string;
|
||||
expiresAt: string;
|
||||
};
|
||||
@ -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 = (
|
||||
|
||||
Reference in New Issue
Block a user