Fix ObjectType casing and conflict between Relation and RelationMetadata (#9849)
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>
This commit is contained in:
@ -1,8 +1,10 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
export const query = gql`
|
||||
mutation CreateOneRelationMetadata($input: CreateOneRelationInput!) {
|
||||
createOneRelation(input: $input) {
|
||||
mutation CreateOneRelationMetadataItem(
|
||||
$input: CreateOneRelationMetadataInput!
|
||||
) {
|
||||
createOneRelationMetadata(input: $input) {
|
||||
id
|
||||
relationType
|
||||
fromObjectMetadataId
|
||||
@ -17,7 +19,7 @@ export const query = gql`
|
||||
|
||||
export const variables = {
|
||||
input: {
|
||||
relation: {
|
||||
relationMetadata: {
|
||||
fromDescription: null,
|
||||
fromIcon: undefined,
|
||||
fromLabel: 'label',
|
||||
|
||||
@ -2,7 +2,7 @@ import { gql } from '@apollo/client';
|
||||
import { mockedStandardObjectMetadataQueryResult } from '~/testing/mock-data/generated/mock-metadata-query-result';
|
||||
|
||||
export const query = gql`
|
||||
query ObjectMetadataItems($objectFilter: objectFilter, $fieldFilter: fieldFilter) {
|
||||
query ObjectMetadataItems($objectFilter: ObjectFilter, $fieldFilter: FieldFilter) {
|
||||
objects(paging: {first: 1000}, filter: $objectFilter) {
|
||||
edges {
|
||||
node {
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { useMutation } from '@apollo/client';
|
||||
|
||||
import {
|
||||
CreateOneRelationMetadataMutation,
|
||||
CreateOneRelationMetadataMutationVariables,
|
||||
CreateOneRelationMetadataItemMutation,
|
||||
CreateOneRelationMetadataItemMutationVariables,
|
||||
} from '~/generated-metadata/graphql';
|
||||
|
||||
import { CREATE_ONE_RELATION_METADATA_ITEM } from '../graphql/mutations';
|
||||
@ -18,8 +18,8 @@ export const useCreateOneRelationMetadataItem = () => {
|
||||
const apolloMetadataClient = useApolloMetadataClient();
|
||||
|
||||
const [mutate] = useMutation<
|
||||
CreateOneRelationMetadataMutation,
|
||||
CreateOneRelationMetadataMutationVariables
|
||||
CreateOneRelationMetadataItemMutation,
|
||||
CreateOneRelationMetadataItemMutationVariables
|
||||
>(CREATE_ONE_RELATION_METADATA_ITEM, {
|
||||
client: apolloMetadataClient,
|
||||
});
|
||||
@ -31,7 +31,9 @@ export const useCreateOneRelationMetadataItem = () => {
|
||||
input: FormatRelationMetadataInputParams,
|
||||
) => {
|
||||
const result = await mutate({
|
||||
variables: { input: { relation: formatRelationMetadataInput(input) } },
|
||||
variables: {
|
||||
input: { relationMetadata: formatRelationMetadataInput(input) },
|
||||
},
|
||||
});
|
||||
|
||||
await refreshObjectMetadataItems();
|
||||
|
||||
Reference in New Issue
Block a user