Optimize metadata queries (#7013)

In this PR:

1. Refactor guards to avoid duplicated queries: WorkspaceAuthGuard and
UserAuthGuard only check for existence of workspace and user in the
request without querying the database
This commit is contained in:
Charles Bochet
2024-09-13 19:11:32 +02:00
committed by Charles Bochet
parent cf8b1161cc
commit 523df5398a
132 changed files with 818 additions and 6372 deletions

View File

@ -83,22 +83,6 @@ const customObjectMetadataItemEdge: ObjectEdge = {
name: 'myCustom',
},
},
toRelationMetadata: null,
fromRelationMetadata: {
__typename: 'relation',
id: 'c5cdbacd-2489-4409-be9e-bb4cb38f6ddd',
relationType: 'ONE_TO_MANY',
toFieldMetadataId: 'c9607ed7-168d-4743-a56a-689ffcfffe98',
toObjectMetadata: {
__typename: 'object',
id: 'dba899da-7d88-41ac-b70e-5ea612ab4b2e',
dataSourceId: 'd36e6a2d-28bc-459d-afd5-fe18e4405729',
nameSingular: 'viewField',
namePlural: 'viewFields',
isSystem: true,
isRemote: false,
},
},
},
},
{
@ -120,8 +104,6 @@ const customObjectMetadataItemEdge: ObjectEdge = {
updatedAt: '2024-04-08T12:48:49.538Z',
defaultValue: null,
relationDefinition: null,
fromRelationMetadata: null,
toRelationMetadata: null,
},
},
{
@ -143,8 +125,6 @@ const customObjectMetadataItemEdge: ObjectEdge = {
updatedAt: '2024-04-08T12:48:49.538Z',
defaultValue: null,
relationDefinition: null,
fromRelationMetadata: null,
toRelationMetadata: null,
},
},
{
@ -166,8 +146,6 @@ const customObjectMetadataItemEdge: ObjectEdge = {
updatedAt: '2024-04-08T12:48:49.538Z',
defaultValue: "''",
relationDefinition: null,
fromRelationMetadata: null,
toRelationMetadata: null,
},
},
{
@ -189,8 +167,6 @@ const customObjectMetadataItemEdge: ObjectEdge = {
updatedAt: '2024-04-08T12:48:49.538Z',
defaultValue: 'now',
relationDefinition: null,
fromRelationMetadata: null,
toRelationMetadata: null,
},
},
{
@ -212,8 +188,6 @@ const customObjectMetadataItemEdge: ObjectEdge = {
updatedAt: '2024-04-08T12:48:49.538Z',
defaultValue: 'now',
relationDefinition: null,
fromRelationMetadata: null,
toRelationMetadata: null,
},
},
{
@ -235,8 +209,6 @@ const customObjectMetadataItemEdge: ObjectEdge = {
updatedAt: '2024-04-08T12:48:49.538Z',
defaultValue: 'uuid',
relationDefinition: null,
fromRelationMetadata: null,
toRelationMetadata: null,
},
},
{
@ -277,8 +249,6 @@ const customObjectMetadataItemEdge: ObjectEdge = {
updatedAt: '2024-04-08T12:48:49.538Z',
defaultValue: null,
relationDefinition: null,
fromRelationMetadata: null,
toRelationMetadata: null,
},
},
],