Download spectrum/shared/graphql/queries/community/getCommunitySettings.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.92 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/shared/graphql/queries/community/getCommunitySettings.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/shared/graphql/queries/community/getCommunitySettings.js
-
curl -L -o getCommunitySettings.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/shared/graphql/queries/community/getCommunitySettings.js
1.92 kB
| // @flow | |
| import { graphql } from 'react-apollo'; | |
| import gql from 'graphql-tag'; | |
| import communityInfoFragment from '../../fragments/community/communityInfo'; | |
| import type { CommunityInfoType } from '../../fragments/community/communityInfo'; | |
| import communitySettingsFragment from '../../fragments/community/communitySettings'; | |
| import type { CommunitySettingsType } from '../../fragments/community/communitySettings'; | |
| import communityMetaDataFragment from '../../fragments/community/communityMetaData'; | |
| import type { CommunityMetaDataType } from '../../fragments/community/communityMetaData'; | |
| export type GetCommunitySettingsType = { | |
| ...$Exact<CommunityInfoType>, | |
| ...$Exact<CommunityMetaDataType>, | |
| ...$Exact<CommunitySettingsType>, | |
| }; | |
| export const getCommunitySettingsQuery = gql` | |
| query getCommunitySettingsById($id: ID) { | |
| community(id: $id) { | |
| ...communityInfo | |
| ...communityMetaData | |
| ...communitySettings | |
| } | |
| } | |
| ${communityInfoFragment} | |
| ${communitySettingsFragment} | |
| ${communityMetaDataFragment} | |
| `; | |
| const getCommunitySettingsOptions = { | |
| options: ({ id }) => ({ | |
| variables: { | |
| id, | |
| }, | |
| fetchPolicy: 'cache-and-network', | |
| }), | |
| }; | |
| export const getCommunitySettingsByMatchQuery = gql` | |
| query getCommunitySettingsByMatch($slug: LowercaseString) { | |
| community(slug: $slug) { | |
| ...communityInfo | |
| ...communityMetaData | |
| ...communitySettings | |
| } | |
| } | |
| ${communityInfoFragment} | |
| ${communitySettingsFragment} | |
| ${communityMetaDataFragment} | |
| `; | |
| const getCommunitySettingsByMatchOptions = { | |
| options: ({ match: { params: { communitySlug } } }) => ({ | |
| variables: { | |
| slug: communitySlug, | |
| }, | |
| fetchPolicy: 'cache-and-network', | |
| }), | |
| }; | |
| export const getCommunitySettingsByMatch = graphql( | |
| getCommunitySettingsByMatchQuery, | |
| getCommunitySettingsByMatchOptions | |
| ); | |
| export default graphql(getCommunitySettingsQuery, getCommunitySettingsOptions); | |