Skip to content

Are Nested values inside graphQLQueryArguments supported for Custom External References? #10700

Description

@adityakhapre

graphQLQueryArguments: { id: '' },

I am implementing Custom External References in our org.
We do have the Premium license.

I am setting a value inside the field, which is a variables object alongside other properties, which I want to use in my query.
e.g.

// Assume other syntax and spelling are correct in these examples

// Field.tsx
sdk.field.setValue({
...other properties
.
.
variables: { where: 
{
    sys: {...}
}
 }
.
.
... other properties
})

I am using this value inside the fieldMappingHandler, as instructed in the Documentation, as follows -

const fieldMappingHandler: FieldMappingHandler = (event) => {
  
  const fields = event.fields.map(({ contentTypeId, field }) => ({
    contentTypeId,
    fieldId: field.id,
    graphQLQueryField: 'someCollection',
    graphQLQueryArguments: { where: '/variables/where' },
  }));

  // Return the mapping and the namespace.
  // The namespace is used to namespace the
  // GraphQL types from the third party API.
  return {
    namespace: 'MockShop',
    fields,
  };
};

But, this does not work.
I only get empty variables with my query when I inspect the function logs.
And thus, also in the actual response I do not get the correct results.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions