Skip to content

Instantly share code, notes, and snippets.

View a7v8x's full-sized avatar
🎮
maximizing reward function in the game of life

David Mraz a7v8x

🎮
maximizing reward function in the game of life
View GitHub Profile
import {
GraphQLString,
GraphQLInputObjectType,
GraphQLNonNull,
GraphQLBoolean,
GraphQLInt,
GraphQLFloat,
} from 'graphql';
import TaskStateEnum from './TaskStateEnumType';
import DateTime from '../custom-scalars/DateTime';
import {
GraphQLString,
GraphQLID,
GraphQLObjectType,
GraphQLNonNull,
GraphQLInt,
GraphQLFloat,
GraphQLBoolean,
} from 'graphql';
import DateTime from '../custom-scalars/DateTime';
"""User type definition"""
type User {
id: ID!
username: String!
email: String
phone: String
firstName: String
lastName: String
}
import {
GraphQLString,
GraphQLID,
GraphQLObjectType,
GraphQLNonNull,
} from 'graphql';
const User = new GraphQLObjectType({
name: 'User',
description: 'User type definition',
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(),
},
/* 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';
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);
export type Maybe<T> = T | null;
export type SubscribeMutationVariables = {
input: SubscribeInput
};
export type SubscribeMutation = (
{ __typename?: 'Mutation' }
& { subscribe: (
{ __typename?: 'Subscription' }
enum SourceEnum {
ARTICLE
HOME_PAGE
}
type Subscription {
id: ID!
email: String!
source: SourceEnum!
}