feat: add Links field type (#5176)

Closes #5113

---------

Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
Thaïs
2024-05-01 11:56:14 +02:00
committed by GitHub
parent e0ece3c917
commit 8853226d17
42 changed files with 465 additions and 61 deletions

View File

@ -69,7 +69,9 @@ export class CompositeInputTypeDefinitionFactory {
options,
{
nullable: !property.isRequired,
isArray: property.type === FieldMetadataType.MULTI_SELECT,
isArray:
property.type === FieldMetadataType.MULTI_SELECT ||
property.isArray,
},
);

View File

@ -69,7 +69,9 @@ export class CompositeObjectTypeDefinitionFactory {
options,
{
nullable: !property.isRequired,
isArray: property.type === FieldMetadataType.MULTI_SELECT,
isArray:
property.type === FieldMetadataType.MULTI_SELECT ||
property.isArray,
},
);

View File

@ -92,6 +92,15 @@ export const mapFieldMetadataToGraphqlQuery = (
url
}
`;
} else if (fieldType === FieldMetadataType.LINKS) {
return `
${field.name}
{
primaryLinkLabel
primaryLinkUrl
secondaryLinks
}
`;
} else if (fieldType === FieldMetadataType.CURRENCY) {
return `
${field.name}