Skip to content

Commit 64d1579

Browse files
committed
Fix casing of element properties
1 parent d573385 commit 64d1579

File tree

4 files changed

+3026
-585
lines changed

4 files changed

+3026
-585
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ import { graphql } from '@/graphql'
154154

155155
export const ParagraphElementFragment = graphql(/* GraphQL */ `
156156
fragment paragraphElement on ParagraphElement {
157-
Text {
157+
text {
158158
html
159159
}
160160
}
@@ -165,7 +165,7 @@ const ParagraphElementComponent = (props: {
165165
}) => {
166166
const paragraphElement = useFragment(ParagraphElementFragment, props.paragraphElement)
167167
// @ts-ignore
168-
return <div dangerouslySetInnerHTML={{ __html: paragraphElement.Text?.html }}></div>
168+
return <div dangerouslySetInnerHTML={{ __html: paragraphElement.text?.html }}></div>
169169
}
170170

171171
export default ParagraphElementComponent

src/components/elements/ParagraphElementComponent.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { graphql } from '@/graphql'
33

44
export const ParagraphElementFragment = graphql(/* GraphQL */ `
55
fragment paragraphElement on ParagraphElement {
6-
Text {
6+
text {
77
html
88
}
99
}
@@ -14,7 +14,7 @@ const ParagraphElementComponent = (props: {
1414
}) => {
1515
const paragraphElement = useFragment(ParagraphElementFragment, props.paragraphElement)
1616
// @ts-ignore
17-
return <div dangerouslySetInnerHTML={{ __html: paragraphElement.Text?.html }}></div>
17+
return <div dangerouslySetInnerHTML={{ __html: paragraphElement.text?.html }}></div>
1818
}
1919

2020
export default ParagraphElementComponent

src/graphql/gql.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/
1515
const documents = {
1616
"\n fragment compositionElementNode on CompositionElementNode {\n key\n element {\n _metadata {\n types\n }\n ...paragraphElement\n }\n }\n": types.CompositionElementNodeFragmentDoc,
1717
"\nquery VisualBuilder($key: String, $version: String) {\n _Experience(where: {\n _metadata: { key: { eq: $key } }\n _or: { _metadata: { version: { eq: $version } } }\n }) {\n items { \n composition {\n grids: nodes {\n ... on CompositionStructureNode {\n key\n rows: nodes {\n ... on CompositionStructureNode {\n key\n columns: nodes {\n ... on CompositionStructureNode {\n key\n elements: nodes {\n ...compositionElementNode\n }\n }\n }\n }\n }\n }\n }\n }\n _metadata {\n key\n version, \n }\n }\n }\n}\n": types.VisualBuilderDocument,
18-
"\n fragment paragraphElement on ParagraphElement {\n Text {\n html\n }\n }\n": types.ParagraphElementFragmentDoc,
18+
"\n fragment paragraphElement on ParagraphElement {\n text {\n html\n }\n }\n": types.ParagraphElementFragmentDoc,
1919
};
2020

2121
/**
@@ -43,7 +43,7 @@ export function graphql(source: "\nquery VisualBuilder($key: String, $version: S
4343
/**
4444
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
4545
*/
46-
export function graphql(source: "\n fragment paragraphElement on ParagraphElement {\n Text {\n html\n }\n }\n"): (typeof documents)["\n fragment paragraphElement on ParagraphElement {\n Text {\n html\n }\n }\n"];
46+
export function graphql(source: "\n fragment paragraphElement on ParagraphElement {\n text {\n html\n }\n }\n"): (typeof documents)["\n fragment paragraphElement on ParagraphElement {\n text {\n html\n }\n }\n"];
4747

4848
export function graphql(source: string) {
4949
return (documents as any)[source] ?? {};

0 commit comments

Comments
 (0)