|
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.
apps/examples/function-mock-shop/functions/mockShop.ts
Line 24 in 4fa4bc7
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
I am using this value inside the fieldMappingHandler, as instructed in the Documentation, as follows -
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.