-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CTF-next: Generate GraphQL schema WITHOUT TEST CHANGES #34032
CTF-next: Generate GraphQL schema WITHOUT TEST CHANGES #34032
Conversation
This reverts commit 8d94396.
}) | ||
} | ||
}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No more content type name restrictions 🎉
ImagePlaceholderType, | ||
ImageResizingBehavior, | ||
} from "./schemes" | ||
import { ImageCropFocusType, ImageResizingBehavior } from "./schemes" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be done outside of this PR. Just a import cleanup 🤷
e | ||
)}`, | ||
}, | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tags are enabled by default 🎉
export { setFieldsOnGraphQLNodeType } from "./extend-node-type" | ||
export { sourceNodes } from "./source-nodes" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a import cleanup. Could be done before this new version gets released 🤷
aspectRatio = | ||
image.file.details.image.width / image.file.details.image.height | ||
width = args.width | ||
height = args.height |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One else
less. YAY!
@@ -0,0 +1,368 @@ | |||
import { getRichTextEntityLinks } from "@contentful/rich-text-links" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file is where the actual magic 🧙 🪄 is happening
) | ||
|
||
// Assets | ||
generateAssetTypes({ createTypes }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's get rid of this function, not need to extract it here only for assets!
node?.sys?.id && | ||
node?.sys?.type === entityType && | ||
links.includes(node.sys.id) | ||
// @todo how can we check for correct space and environment? We need to access the sys field of the fields parent entry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unresolved @todo
) | ||
|
||
// Text | ||
// @todo Is there a way to have this as string and let transformer-remark replace it with an object? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unresolved @todo
fields: { | ||
raw: `String!`, | ||
}, | ||
// @todo do we need a node interface here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unresolved @todo
|
||
return JSONNode | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No more ContentfulJSON nodes! 🎉
|
||
entryItemFields[`${entryItemFieldKey}___NODE`].push(jsonNodeId) | ||
}) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No more ContentfulJSON and ContentfulRichText nodes 🎉
url: file.url, | ||
size: file.details.size, | ||
width: file.details?.image?.width || null, | ||
height: file.details?.image?.height || null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assets are now flat 🎉
@@ -11,7 +11,6 @@ const defaultOptions = { | |||
localeFilter: () => true, | |||
pageLimit: DEFAULT_PAGE_LIMIT, | |||
useNameForId: true, | |||
enableTags: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋 enableTags
@@ -1,46 +1,52 @@ | |||
// @ts-check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WAY less magic in here thanks to pure JSON in our GraphQL DB 🎉
foreignReferenceMap[id].forEach(foreignReference => { | ||
// Add reverse links | ||
if (n[foreignReference.name]) { | ||
n[foreignReference.name].push(foreignReference.id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this breaks the unit tests // reference resolving 🤷
space, | ||
}) | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change could/should also happen before this major. Just a cleanup/restructure.
const { | ||
file: { contentType, url: imgUrl, fileName }, | ||
} = asset | ||
const { contentType, url: imgUrl, fileName } = asset |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flat assets 🎉
This is the same PR as #30855, but without any changes to unit tests, fixtures or e2e tests.
The changes in the tests are massive, so I decided to create this sidecar PR to highlight what actually changes in #30053.