Fixes #9827 Also uncovered a conflict with `@objectType('Relation')` and `@objectType('relation)` I don't want to address it in this PR so I will create a followup issue when we close this but I think there's a confusion between Relation/RelationMetadata, it's unclear what is what --------- Co-authored-by: Antoine Moreaux <moreaux.antoine@gmail.com>
27 lines
629 B
TypeScript
27 lines
629 B
TypeScript
import gql from 'graphql-tag';
|
|
|
|
import { CreateRelationInput } from 'src/engine/metadata-modules/relation-metadata/dtos/create-relation.input';
|
|
|
|
type CreateOneRelationFactoryParams = {
|
|
gqlFields: string;
|
|
input?: {
|
|
relation: Omit<CreateRelationInput, 'workspaceId'>;
|
|
};
|
|
};
|
|
|
|
export const createOneRelationMetadataFactory = ({
|
|
gqlFields,
|
|
input,
|
|
}: CreateOneRelationFactoryParams) => ({
|
|
query: gql`
|
|
mutation CreateOneRelationMetadata($input: CreateOneRelationMetadataInput!) {
|
|
createOneRelationMetadata(input: $input) {
|
|
${gqlFields}
|
|
}
|
|
}
|
|
`,
|
|
variables: {
|
|
input,
|
|
},
|
|
});
|