forked from twentyhq/twenty
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove relations for remotes (twentyhq#5455)
For remotes, we will only create the foreign key, without the relation metadata. Expected behavior will be: - possible to create an activity. But the remote object will not be displayed in the relations of the activity - the remote objects should not be available in the search for relations Also switched the number settings to an enum, since we now have to handle `BigInt` case. --------- Co-authored-by: Thomas Trompette <thomast@twenty.com>
- Loading branch information
Showing
12 changed files
with
454 additions
and
479 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 9 additions & 13 deletions
22
...ine/api/graphql/workspace-schema-builder/graphql-types/input/big-int-filter.input-type.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,18 @@ | ||
import { | ||
GraphQLInputObjectType, | ||
GraphQLList, | ||
GraphQLNonNull, | ||
GraphQLInt, | ||
} from 'graphql'; | ||
import { GraphQLInputObjectType, GraphQLList, GraphQLNonNull } from 'graphql'; | ||
import { GraphQLBigInt } from 'graphql-scalars'; | ||
|
||
import { FilterIs } from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/input/filter-is.input-type'; | ||
|
||
export const BigIntFilterType = new GraphQLInputObjectType({ | ||
name: 'BigIntFilter', | ||
fields: { | ||
eq: { type: GraphQLInt }, | ||
gt: { type: GraphQLInt }, | ||
gte: { type: GraphQLInt }, | ||
in: { type: new GraphQLList(new GraphQLNonNull(GraphQLInt)) }, | ||
lt: { type: GraphQLInt }, | ||
lte: { type: GraphQLInt }, | ||
neq: { type: GraphQLInt }, | ||
eq: { type: GraphQLBigInt }, | ||
gt: { type: GraphQLBigInt }, | ||
gte: { type: GraphQLBigInt }, | ||
in: { type: new GraphQLList(new GraphQLNonNull(GraphQLBigInt)) }, | ||
lt: { type: GraphQLBigInt }, | ||
lte: { type: GraphQLBigInt }, | ||
neq: { type: GraphQLBigInt }, | ||
is: { type: FilterIs }, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...rver/src/engine/api/graphql/workspace-schema-builder/utils/get-number-filter-type.util.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import { GraphQLInputObjectType } from 'graphql'; | ||
|
||
import { NumberDataType } from 'src/engine/metadata-modules/field-metadata/interfaces/field-metadata-settings.interface'; | ||
|
||
import { | ||
BigIntFilterType, | ||
FloatFilterType, | ||
IntFilterType, | ||
} from 'src/engine/api/graphql/workspace-schema-builder/graphql-types/input'; | ||
|
||
export const getNumberFilterType = ( | ||
subType: NumberDataType | undefined, | ||
): GraphQLInputObjectType => { | ||
switch (subType) { | ||
case NumberDataType.FLOAT: | ||
return FloatFilterType; | ||
case NumberDataType.BIGINT: | ||
return BigIntFilterType; | ||
case NumberDataType.INT: | ||
return IntFilterType; | ||
default: | ||
return FloatFilterType; | ||
} | ||
}; |
19 changes: 19 additions & 0 deletions
19
...rver/src/engine/api/graphql/workspace-schema-builder/utils/get-number-scalar-type.util.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { GraphQLInt, GraphQLFloat, GraphQLScalarType } from 'graphql'; | ||
import { GraphQLBigInt } from 'graphql-scalars'; | ||
|
||
import { NumberDataType } from 'src/engine/metadata-modules/field-metadata/interfaces/field-metadata-settings.interface'; | ||
|
||
export const getNumberScalarType = ( | ||
dataType: NumberDataType, | ||
): GraphQLScalarType => { | ||
switch (dataType) { | ||
case NumberDataType.FLOAT: | ||
return GraphQLFloat; | ||
case NumberDataType.BIGINT: | ||
return GraphQLBigInt; | ||
case NumberDataType.INT: | ||
return GraphQLInt; | ||
default: | ||
return GraphQLFloat; | ||
} | ||
}; |
8 changes: 7 additions & 1 deletion
8
...rc/engine/metadata-modules/field-metadata/interfaces/field-metadata-settings.interface.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.