feat: fetch database connection tables in Settings/Integrations/Datab… (#4882)
…ase/Connection Closes #4758 --------- Co-authored-by: Thomas Trompette <thomast@twenty.com>
This commit is contained in:
@ -0,0 +1,12 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const DATABASE_CONNECTION_FRAGMENT = gql`
|
||||
fragment RemoteServerFields on RemoteServer {
|
||||
id
|
||||
createdAt
|
||||
foreignDataWrapperId
|
||||
foreignDataWrapperOptions
|
||||
foreignDataWrapperType
|
||||
updatedAt
|
||||
}
|
||||
`;
|
||||
@ -1,12 +1,12 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
import { DATABASE_CONNECTION_FRAGMENT } from '@/databases/graphql/fragments/databaseConnectionFragment';
|
||||
|
||||
export const CREATE_ONE_DATABASE_CONNECTION = gql`
|
||||
${DATABASE_CONNECTION_FRAGMENT}
|
||||
mutation createServer($input: CreateRemoteServerInput!) {
|
||||
createOneRemoteServer(input: $input) {
|
||||
id
|
||||
foreignDataWrapperId
|
||||
foreignDataWrapperOptions
|
||||
foreignDataWrapperType
|
||||
...RemoteServerFields
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@ -0,0 +1,11 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const GET_MANY_DATABASE_CONNECTION_TABLES = gql`
|
||||
query GetManyDatabaseConnectionTables($input: RemoteServerIdInput!) {
|
||||
findAvailableRemoteTablesByServerId(input: $input) {
|
||||
name
|
||||
schema
|
||||
status
|
||||
}
|
||||
}
|
||||
`;
|
||||
@ -1,14 +1,12 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
import { DATABASE_CONNECTION_FRAGMENT } from '@/databases/graphql/fragments/databaseConnectionFragment';
|
||||
|
||||
export const GET_MANY_DATABASE_CONNECTIONS = gql`
|
||||
${DATABASE_CONNECTION_FRAGMENT}
|
||||
query GetManyDatabaseConnections($input: RemoteServerTypeInput!) {
|
||||
findManyRemoteServersByType(input: $input) {
|
||||
id
|
||||
createdAt
|
||||
foreignDataWrapperId
|
||||
foreignDataWrapperOptions
|
||||
foreignDataWrapperType
|
||||
updatedAt
|
||||
...RemoteServerFields
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@ -0,0 +1,12 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
import { DATABASE_CONNECTION_FRAGMENT } from '@/databases/graphql/fragments/databaseConnectionFragment';
|
||||
|
||||
export const GET_ONE_DATABASE_CONNECTION = gql`
|
||||
${DATABASE_CONNECTION_FRAGMENT}
|
||||
query GetOneDatabaseConnection($input: RemoteServerIdInput!) {
|
||||
findOneRemoteServerById(input: $input) {
|
||||
...RemoteServerFields
|
||||
}
|
||||
}
|
||||
`;
|
||||
Reference in New Issue
Block a user