Skip to content

Commit 99986f5

Browse files
authored
Merge pull request #24313 from github/repo-sync
repo sync
2 parents f9eb09f + 0430962 commit 99986f5

File tree

11 files changed

+56
-35
lines changed

11 files changed

+56
-35
lines changed

components/graphql/Enum.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type Props = {
1010

1111
export function Enum({ item }: Props) {
1212
const { t } = useTranslation('products')
13-
const heading = t('graphql.reference.values')
13+
const heading = t('graphql.reference.values').replace('{{ GraphQLItemTitle }}', item.name)
1414

1515
return (
1616
<GraphqlItem item={item} heading={heading}>

components/graphql/GraphqlItem.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ export function GraphqlItem({ item, heading, children, headingLevel = 2 }: Props
1616
{headingLevel === 2 && (
1717
<h2 id={lowerCaseName}>
1818
<LinkIconHeading slug={lowerCaseName} />
19-
{item.name}
19+
<code>{item.name}</code>
2020
</h2>
2121
)}
2222
{headingLevel === 3 && (
2323
<h3 id={lowerCaseName}>
2424
<LinkIconHeading slug={lowerCaseName} />
25-
{item.name}
25+
<code>{item.name}</code>
2626
</h3>
2727
)}
2828
<div
@@ -35,7 +35,7 @@ export function GraphqlItem({ item, heading, children, headingLevel = 2 }: Props
3535
{item.isDeprecated && <Notice item={item} variant="deprecation" />}
3636
</div>
3737
<div>
38-
{heading && <h4>{heading}</h4>}
38+
{heading && <h4 dangerouslySetInnerHTML={{ __html: heading }} />}
3939
{children}
4040
</div>
4141
</div>

components/graphql/InputObject.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type Props = {
99

1010
export function InputObject({ item }: Props) {
1111
const { t } = useTranslation('products')
12-
const heading = t('graphql.reference.input_fields')
12+
const heading = t('graphql.reference.input_fields').replace('{{ GraphQLItemTitle }}', item.name)
1313
return (
1414
<GraphqlItem item={item} heading={heading}>
1515
<Table fields={item.inputFields} />

components/graphql/Interface.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ type Props = {
1414
export function Interface({ item, objects }: Props) {
1515
const { locale } = useRouter()
1616
const { t } = useTranslation('products')
17-
const heading = t('graphql.reference.implemented_by')
18-
const heading2 = t('graphql.reference.fields')
17+
const heading = t('graphql.reference.implemented_by').replace('{{ GraphQLItemTitle }}', item.name)
18+
const heading2 = t('graphql.reference.fields').replace('{{ GraphQLItemTitle }}', item.name)
1919

2020
const implementedBy = objects.filter(
2121
(object) =>
@@ -38,7 +38,11 @@ export function Interface({ item, objects }: Props) {
3838
</ul>
3939
{item.fields && (
4040
<>
41-
<h4>{heading2}</h4>
41+
<h4
42+
dangerouslySetInnerHTML={{
43+
__html: heading2,
44+
}}
45+
/>
4246
<Table fields={item.fields} />
4347
</>
4448
)}

components/graphql/Mutation.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ type Props = {
1515
export function Mutation({ item }: Props) {
1616
const { locale } = useRouter()
1717
const { t } = useTranslation('products')
18-
const heading = t('graphql.reference.input_fields')
19-
const heading2 = t('graphql.reference.return_fields')
18+
const heading = t('graphql.reference.input_fields').replace('{{ GraphQLItemTitle }}', item.name)
19+
const heading2 = t('graphql.reference.return_fields').replace('{{ GraphQLItemTitle }}', item.name)
2020

2121
return (
2222
<GraphqlItem item={item} heading={heading}>
@@ -36,7 +36,7 @@ export function Mutation({ item }: Props) {
3636

3737
{input.preview && <Notice item={input} variant="preview" />}
3838
{input.isDeprecated && <Notice item={input} variant="deprecation" />}
39-
<h4>{heading2}</h4>
39+
<h4 dangerouslySetInnerHTML={{ __html: heading2 }} />
4040
<Table fields={item.returnFields} />
4141
</React.Fragment>
4242
))}

components/graphql/Object.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ type Props = {
1313
export function Object({ item }: Props) {
1414
const { locale } = useRouter()
1515
const { t } = useTranslation('products')
16-
const heading1 = t('graphql.reference.implements')
17-
const heading2 = t('graphql.reference.fields')
16+
const heading1 = t('graphql.reference.implements').replace('{{ GraphQLItemTitle }}', item.name)
17+
const heading2 = t('graphql.reference.fields').replace('{{ GraphQLItemTitle }}', item.name)
1818

1919
return (
2020
<GraphqlItem item={item}>
2121
{item.implements && (
2222
<>
23-
<h3>{heading1}</h3>
23+
<h3 dangerouslySetInnerHTML={{ __html: heading1 }} />
2424
<ul>
2525
{item.implements.map((implement: ImplementsT) => (
2626
<li key={`${implement.id}-${implement.href}-${implement.name}`}>
@@ -37,7 +37,7 @@ export function Object({ item }: Props) {
3737

3838
{item.fields && (
3939
<>
40-
<h3>{heading2}</h3>
40+
<h3 dangerouslySetInnerHTML={{ __html: heading2 }} />
4141
<Table fields={item.fields} />
4242
</>
4343
)}

components/graphql/Query.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,14 @@ export function Query({ item }: Props) {
2828
<div>
2929
{item.args.length > 0 && (
3030
<>
31-
<h4>{t('graphql.reference.arguments')}</h4>
31+
<h4
32+
dangerouslySetInnerHTML={{
33+
__html: t('graphql.reference.arguments').replace(
34+
'{{ GraphQLItemTitle }}',
35+
item.name
36+
),
37+
}}
38+
/>
3239
<Table fields={item.args} />
3340
</>
3441
)}

components/graphql/Table.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,15 @@ export function Table({ fields }: Props) {
5858

5959
{field.arguments && (
6060
<div className="border rounded-1 mt-3 mb-3 p-3 color-bg-subtle f5">
61-
<h4 className="pt-0 mt-0">{t('graphql.reference.arguments')}</h4>
61+
<p
62+
className="pt-0 mt-0 h5"
63+
dangerouslySetInnerHTML={{
64+
__html: t('graphql.reference.arguments').replace(
65+
'{{ GraphQLItemTitle }}',
66+
field.name
67+
),
68+
}}
69+
/>
6270
{field.arguments.map((argument, index) => (
6371
<ul
6472
key={`${index}-${argument.type.name}-${argument.type.href}`}

components/graphql/Union.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ type Props = {
1212
export function Union({ item }: Props) {
1313
const { locale } = useRouter()
1414
const { t } = useTranslation('products')
15-
const heading = t('graphql.reference.possible_types')
15+
const heading = t('graphql.reference.possible_types').replace('{{ GraphQLItemTitle }}', item.name)
1616

1717
return (
1818
<GraphqlItem item={item} heading={heading}>
1919
<ul>
2020
{item.possibleTypes.map((type) => (
2121
<li key={type.id}>
2222
<Link href={type.href} locale={locale}>
23-
{type.name}
23+
<code>{type.name}</code>
2424
</Link>
2525
</li>
2626
))}

data/ui.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,17 +103,18 @@ parameter_table:
103103
products:
104104
graphql:
105105
reference:
106-
implements: Implements
107-
fields: Fields
108-
arguments: Arguments
106+
implements: <code>{{ GraphQLItemTitle }}</code> Implements
107+
fields: Fields for <code>{{ GraphQLItemTitle }}</code>
108+
arguments: Arguments for <code>{{ GraphQLItemTitle }}</code>
109109
name: Name
110110
type: Type
111111
description: Description
112-
input_fields: Input fields
113-
return_fields: Return fields
114-
implemented_by: Implemented by
115-
values: Values
116-
possible_types: Possible types
112+
input_fields: Input fields for <code>{{ GraphQLItemTitle }}</code>
113+
return_fields: Return fields for <code>{{ GraphQLItemTitle }}</code>
114+
implemented_by: |
115+
<code>{{ GraphQLItemTitle }}</code> is implemented by
116+
values: Values for <code>{{ GraphQLItemTitle }}</code>
117+
possible_types: Possible types for <code>{{ GraphQLItemTitle }}</code>
117118
preview_notice: Preview notice
118119
deprecation_notice: Deprecation notice
119120
preview_period: During the preview period, the API may change without notice.

0 commit comments

Comments
 (0)