Download spectrum/shared/graphql/queries/user/getUserCommunityConnection.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 1.49 kB
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/shared/graphql/queries/user/getUserCommunityConnection.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/shared/graphql/queries/user/getUserCommunityConnection.js
-
curl -L -o getUserCommunityConnection.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/shared/graphql/queries/user/getUserCommunityConnection.js
1.49 kB
| // @flow | |
| import { graphql } from 'react-apollo'; | |
| import gql from 'graphql-tag'; | |
| import userInfoFragment from '../../fragments/user/userInfo'; | |
| import type { UserInfoType } from '../../fragments/user/userInfo'; | |
| import userCommunityConnectionFragment from '../../fragments/user/userCommunityConnection'; | |
| import type { UserCommunityConnectionType } from '../../fragments/user/userCommunityConnection'; | |
| export type GetUserCommunityConnectionType = { | |
| ...$Exact<UserInfoType>, | |
| ...$Exact<UserCommunityConnectionType>, | |
| }; | |
| export const getUserCommunityConnectionQuery = gql` | |
| query getUserCommunityConnection($id: ID) { | |
| user(id: $id) { | |
| ...userInfo | |
| ...userCommunityConnection | |
| } | |
| } | |
| ${userInfoFragment} | |
| ${userCommunityConnectionFragment} | |
| `; | |
| export const getCurrentUserCommunityConnectionQuery = gql` | |
| query getCurrentUserCommunityConnection { | |
| user: currentUser { | |
| ...userInfo | |
| ...userCommunityConnection | |
| } | |
| } | |
| ${userInfoFragment} | |
| ${userCommunityConnectionFragment} | |
| `; | |
| const getUserCommunityConnectionOptions = { | |
| options: ({ id }) => ({ | |
| variables: { | |
| id, | |
| }, | |
| fetchPolicy: 'cache-and-network', | |
| }), | |
| }; | |
| export const getCurrentUserCommunityConnection = graphql( | |
| getCurrentUserCommunityConnectionQuery, | |
| { | |
| options: { fetchPolicy: 'cache-first' }, | |
| props: props => ({ | |
| ...props, | |
| }), | |
| } | |
| ); | |
| export const getUserCommunityConnection = graphql( | |
| getUserCommunityConnectionQuery, | |
| getUserCommunityConnectionOptions | |
| ); | |