This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
GraphQLString, | |
GraphQLInputObjectType, | |
GraphQLNonNull, | |
GraphQLBoolean, | |
GraphQLInt, | |
GraphQLFloat, | |
} from 'graphql'; | |
import TaskStateEnum from './TaskStateEnumType'; | |
import DateTime from '../custom-scalars/DateTime'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
GraphQLString, | |
GraphQLID, | |
GraphQLObjectType, | |
GraphQLNonNull, | |
GraphQLInt, | |
GraphQLFloat, | |
GraphQLBoolean, | |
} from 'graphql'; | |
import DateTime from '../custom-scalars/DateTime'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""User type definition""" | |
type User { | |
id: ID! | |
username: String! | |
email: String | |
phone: String | |
firstName: String | |
lastName: String | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
GraphQLString, | |
GraphQLID, | |
GraphQLObjectType, | |
GraphQLNonNull, | |
} from 'graphql'; | |
const User = new GraphQLObjectType({ | |
name: 'User', | |
description: 'User type definition', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { getSubscriptions, createSubscription } from '../requests/subscription-requests'; | |
import { Resolvers } from '../__generated__/resolver-types'; | |
interface StringIndexSignatureInterface { | |
[index: string]: any; | |
} | |
type StringIndexed<T> = T & StringIndexSignatureInterface | |
const resolvers: StringIndexed<Resolvers> = { | |
Query: { | |
subscriptions: () => getSubscriptions(), | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable jsx-a11y/label-has-for */ | |
import React from 'react'; | |
import { useMutation } from '@apollo/react-hooks'; | |
import { | |
Formik, ErrorMessage, Form, Field, | |
} from 'formik'; | |
import * as Yup from 'yup'; | |
// eslint-disable-next-line import/no-extraneous-dependencies | |
import { FetchResult } from 'apollo-link'; | |
import get from 'lodash.get'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mport React from 'react'; | |
import get from 'lodash.get'; | |
import uuid from 'uuid/v1'; | |
import { useQuery } from '@apollo/react-hooks'; | |
import SUBSCRIPTIONS_QUERY from './SUBSCRIPTIONS.graphql'; | |
import { SubscriptionsQuery, SubscriptionsQueryVariables } from '../../../__generated__/typescript-operations'; | |
import s from './SubscriptionsTable.scss'; | |
const SubscriptionsTable: React.FunctionComponent = () => { | |
const { data, loading, error } = useQuery<SubscriptionsQuery, | |
SubscriptionsQueryVariables>(SUBSCRIPTIONS_QUERY); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type Maybe<T> = T | null; | |
export type SubscribeMutationVariables = { | |
input: SubscribeInput | |
}; | |
export type SubscribeMutation = ( | |
{ __typename?: 'Mutation' } | |
& { subscribe: ( | |
{ __typename?: 'Subscription' } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
query getSubscriptions { | |
subscriptions { | |
id | |
source | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum SourceEnum { | |
ARTICLE | |
HOME_PAGE | |
} | |
type Subscription { | |
id: ID! | |
email: String! | |
source: SourceEnum! | |
} |