forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathQuery.tsx
More file actions
39 lines (35 loc) · 949 Bytes
/
Query.tsx
File metadata and controls
39 lines (35 loc) · 949 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { Link } from 'src/frame/components/Link'
import { GraphqlItem } from './GraphqlItem'
import { Table } from './Table'
import { useTranslation } from 'src/languages/components/useTranslation'
import type { QueryT } from './types'
type Props = {
item: QueryT
}
export function Query({ item }: Props) {
const { t } = useTranslation('graphql')
return (
<GraphqlItem item={item} headingLevel={3}>
<div>
<p>
<b>{t('graphql.reference.type')}: </b>
<Link href={item.href} makeAbsolute>
{item.type}
</Link>
</p>
</div>
<div>
{item.args.length > 0 && (
<>
<h4
dangerouslySetInnerHTML={{
__html: t('reference.arguments').replace('{{ GraphQLItemTitle }}', item.name),
}}
/>
<Table fields={item.args} />
</>
)}
</div>
</GraphqlItem>
)
}