Skip to content

Commit

Permalink
feat(type-model): update transformer files
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Creasman authored and Jonathan Creasman committed Jan 3, 2024
1 parent ca2ab30 commit 59f6864
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
24 changes: 21 additions & 3 deletions models/type/src/type/transformers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,32 @@ import type { TType, TTypeGraphql } from './types';

const transformers = {
default: Transformer<TType, TType>('default', {
buildFields: ['name', 'description', 'createdBy', 'lastModifiedBy'],
buildFields: [
'name',
'description',
'createdBy',
'lastModifiedBy',
'fieldDefinitions',
],
}),
rest: Transformer<TType, TType>('rest', {
buildFields: ['name', 'description', 'createdBy', 'lastModifiedBy'],
buildFields: [
'name',
'description',
'createdBy',
'lastModifiedBy',
'fieldDefinitions',
],
}),
// Note that the Type graphql is provided as scaffolding only and may not be complete at this time.
graphql: Transformer<TType, TTypeGraphql>('graphql', {
buildFields: ['name', 'description', 'createdBy', 'lastModifiedBy'],
buildFields: [
'name',
'description',
'createdBy',
'lastModifiedBy',
'fieldDefinitions',
],
addFields: ({ fields }) => {
const nameAllLocales = LocalizedString.toLocalizedField(fields.name);
const descriptionAllLocales = LocalizedString.toLocalizedField(
Expand Down
6 changes: 3 additions & 3 deletions models/type/src/type/type-draft/transformers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import type { TTypeDraft, TTypeDraftGraphql } from '../types';

const transformers = {
default: Transformer<TTypeDraft, TTypeDraft>('default', {
buildFields: ['name', 'description'],
buildFields: ['name', 'description', 'fieldDefinitions'],
}),
rest: Transformer<TTypeDraft, TTypeDraft>('rest', {
buildFields: ['name', 'description'],
buildFields: ['name', 'description', 'fieldDefinitions'],
}),
// Note that the TypeDraft graphql is provided as scaffolding only and may not be complete at this time.
graphql: Transformer<TTypeDraft, TTypeDraftGraphql>('graphql', {
buildFields: ['name', 'description'],
buildFields: ['name', 'description', 'fieldDefinitions'],
}),
};

Expand Down

0 comments on commit 59f6864

Please sign in to comment.