Feat/add other metadata types v2 (#2224)
* Fix view fetch bug * Finished types * Removed console.log * Fixed todo * Reactivate no console * Change no-console to warn
This commit is contained in:
@ -1,9 +1,9 @@
|
||||
import { gql } from '@apollo/client';
|
||||
|
||||
import { FieldType } from '@/ui/data/field/types/FieldType';
|
||||
|
||||
import { MetadataObject } from '../types/MetadataObject';
|
||||
|
||||
import { mapFieldMetadataToGraphQLQuery } from './mapFieldMetadataToGraphQLQuery';
|
||||
|
||||
export const generateFindManyCustomObjectsQuery = ({
|
||||
metadataObject,
|
||||
_fromCursor,
|
||||
@ -18,22 +18,7 @@ export const generateFindManyCustomObjectsQuery = ({
|
||||
node {
|
||||
id
|
||||
${metadataObject.fields
|
||||
.map((field) => {
|
||||
// TODO: parse
|
||||
const fieldType = field.type as FieldType;
|
||||
|
||||
if (fieldType === 'text') {
|
||||
return field.name;
|
||||
} else if (fieldType === 'url') {
|
||||
return `
|
||||
${field.name}
|
||||
{
|
||||
text
|
||||
link
|
||||
}
|
||||
`;
|
||||
}
|
||||
})
|
||||
.map(mapFieldMetadataToGraphQLQuery)
|
||||
.join('\n')}
|
||||
}
|
||||
cursor
|
||||
|
||||
Reference in New Issue
Block a user