Skip to content

Commit

Permalink
Next api
Browse files Browse the repository at this point in the history
Squashed commit of the following:

commit a108877910e0556759f92e9acab4643c63be13ff
Author: Mikhail Novikov <freiksenet@gmail.com>
Date:   Wed Jan 31 16:05:00 2018 +0200

    First transforms

commit 334802c
Merge: 99884b6 e9c0eb5
Author: Mikhail Novikov <freiksenet@gmail.com>
Date:   Fri Jan 26 12:27:57 2018 +0200

    Merge remote-tracking branch 'origin/master' into next-api

commit 99884b6
Author: Mikhail Novikov <freiksenet@gmail.com>
Date:   Fri Jan 26 11:57:15 2018 +0200

    Restored valid fragments

commit f1b2432
Author: Mikhail Novikov <freiksenet@gmail.com>
Date:   Thu Jan 25 14:55:57 2018 +0200

    Progress :P

commit db2806a
Author: Mikhail Novikov <freiksenet@gmail.com>
Date:   Thu Jan 25 13:35:35 2018 +0200

    Fragment replacement

commit e9c0eb5
Author: Mikhail Novikov <freiksenet@gmail.com>
Date:   Wed Jan 24 18:28:12 2018 +0200

    v2.19.0 (#594)

commit e33c215
Author: Mikhail Novikov <freiksenet@gmail.com>
Date:   Wed Jan 24 16:31:37 2018 +0200

    Progress

commit 464670f
Author: Mikhail Novikov <freiksenet@gmail.com>
Date:   Tue Jan 23 15:03:40 2018 +0200

    More progress

commit 22d2295
Author: Sebastian Richter <sebastian.max.richter@gmail.com>
Date:   Tue Jan 23 12:45:49 2018 +0100

    Also recreate astNode for fields (#580)

    * Also recreate astNode for fields

    In a [previous commit](fd9f626) we added the `astNode` property in the `reacreateCompositeType` function. That resulted in cache control working with schema stitching but only for GraphQL Types. By recreating the `astNode` prop also in `fieldToFieldConfig` cache control also works for fields. This is required for caching fields and hence queries.

    * Add ast to input field node too

commit 03ad432
Author: Renato Benkendorf <renatobenks@users.noreply.github.com>
Date:   Tue Jan 23 08:35:00 2018 -0200

    Fix resolvers to accept and move forward args with zero or false values (#586)

    Fixing the args with zero value or false

commit 72ac16f
Author: Mikhail Novikov <freiksenet@gmail.com>
Date:   Tue Jan 23 11:37:02 2018 +0200

    Upgrade remap-istanbul (#590)

commit 5420557
Merge: 24a0f3f 3ef557a
Author: Sashko Stubailo <sashko@meteor.com>
Date:   Mon Jan 22 11:55:07 2018 -0800

    Merge pull request #584 from shackpank/double_deps

    Remove graphql-subscriptions from devDependencies

commit 3ef557a
Author: Ollie Buck <git@olliebuck.com>
Date:   Fri Jan 19 14:40:03 2018 +0000

    Remove graphql-subscriptions from devDependencies

commit 7e4efe9
Author: Mikhail Novikov <freiksenet@gmail.com>
Date:   Thu Jan 18 16:38:13 2018 +0200

    Progress

commit 24a0f3f
Author: Mikhail Novikov <freiksenet@gmail.com>
Date:   Wed Jan 10 12:36:43 2018 +0200

    v2.18.0 (#574)

commit 966e102
Author: Amit-A <Amit-A@users.noreply.github.com>
Date:   Wed Jan 10 02:53:56 2018 -0500

    Fixing broken links (#573)

commit 94b8f68
Author: Pascal Kaufmann <pozylon@gmail.com>
Date:   Tue Jan 9 12:51:53 2018 +0100

    Fix fragment filtering edge case when a type implements multiple interfaces (#546)

    * add failing test for multi interface issue

    * interface / interface always implements an abstract type

    * changelog

    * the linter always should be happy

    * Update CHANGELOG.md

commit 608414b
Author: Tim Griesser <tgriesser10@gmail.com>
Date:   Tue Jan 9 06:15:12 2018 -0500

    Allow IEnumResolver values to be number type (#568)

    * Allow IEnumResolver values to be number type

commit 6177034
Author: Mikhail Novikov <freiksenet@gmail.com>
Date:   Tue Jan 9 11:26:04 2018 +0200

    v2.17.0 (#571)

commit fd9f626
Author: Sebastian Richter <sebastian.max.richter@gmail.com>
Date:   Tue Jan 9 09:25:16 2018 +0100

    Include astNode in schema recreation (#569)

    * Update schemaRecreation.ts

    `mergeSchemas` does not set `astNode` properties, when recreating types.
    But `CacheControlExtension.willResolveField` uses the `astNode` property in order to get the `cacheControl` directives.

commit 4f489d3
Author: Mikhail Novikov <freiksenet@gmail.com>
Date:   Wed Jan 3 15:40:21 2018 +0200

    v2.16.0 (#564)

commit c4c5d91
Author: VimalRaj Selvam <email2vimalraj@gmail.com>
Date:   Wed Jan 3 19:00:16 2018 +0530

    #544 - Update docs and tests to reflect new strings-as-descriptions pattern in new GraphQL SDL (#559)

    * #64 - Update docs and tests to reflect new strings-as-descriptions pattern in new GraphQL SDL

    * Make tests compatible with graphql v0.11

    * Fix test errors

    * Remove extra space

    * Fix review comments

commit 66d58bb
Author: Alvis Tang <alvis@users.noreply.github.com>
Date:   Wed Jan 3 13:25:59 2018 +0000

    fix: correct the dependency issue in typescript caused by #445 (#561)

    fix #472

commit 342bece
Author: Johannes Schickling <schickling.j@gmail.com>
Date:   Wed Jan 3 14:21:35 2018 +0100

    Add subscriptions support to `makeRemoteExectuableSchema` (#563)

    Added subscriptions support to makeRemoteExectuableSchema

commit 8e8e348
Author: Mikhail Novikov <freiksenet@gmail.com>
Date:   Tue Jan 2 14:50:06 2018 +0200

    v2.15.0 (#562)

commit f2905ac
Author: Johannes Schickling <schickling.j@gmail.com>
Date:   Tue Jan 2 13:40:56 2018 +0100

    Add document validation to `delegateToSchema` (#551)

    * Add document validation to `delegateToSchema`

commit 59592e1
Merge: 3e24c69 3612216
Author: Sashko Stubailo <sashko@meteor.com>
Date:   Thu Dec 28 10:02:28 2017 -0800

    Merge pull request #556 from enaqx/patch-4

    doc: fix Generating schema URL on Mocking page

commit 3612216
Author: Sashko Stubailo <sashko@meteor.com>
Date:   Thu Dec 28 10:00:16 2017 -0800

    Update mocking.md

commit 3e24c69
Merge: 7089bbf 42d180d
Author: Sashko Stubailo <sashko@meteor.com>
Date:   Thu Dec 28 09:58:31 2017 -0800

    Merge pull request #557 from tbroadley/fix-typos

    docs: fix typos

commit 42d180d
Merge: 5130cf6 7089bbf
Author: Sashko Stubailo <sashko@meteor.com>
Date:   Thu Dec 28 09:57:11 2017 -0800

    Merge branch 'master' into fix-typos

commit 7089bbf
Merge: 3a58286 5048434
Author: Sashko Stubailo <sashko@meteor.com>
Date:   Thu Dec 28 09:52:44 2017 -0800

    Merge pull request #552 from mklopets/patch-2

    Fix link to Apollo Link docs

commit 5048434
Author: Marko Klopets <mklopets@users.noreply.github.com>
Date:   Thu Dec 28 14:23:07 2017 +0200

    Re-fix link

commit 5130cf6
Author: Thomas Broadley <buriedunderbooks@hotmail.com>
Date:   Mon Dec 25 17:45:44 2017 -0500

    docs: fix typos

commit 80f2f4c
Author: Nick Raienko <enaqxx@gmail.com>
Date:   Mon Dec 25 09:19:03 2017 +0200

    doc: fix Generating schema URL on Mocking page

commit e295019
Author: Marko Klopets <mklopets@users.noreply.github.com>
Date:   Thu Dec 21 13:18:59 2017 +0200

    Fix link to Apollo Link docs

commit 3a58286
Merge: 259f22e 971e96e
Author: Sashko Stubailo <sashko@meteor.com>
Date:   Wed Dec 20 11:26:55 2017 -0800

    Merge pull request #548 from apollographql/create-2.14.1

    v2.14.1

commit 971e96e
Author: Mikhail Novikov <freiksenet@gmail.com>
Date:   Wed Dec 20 12:44:14 2017 +0200

    v2.14.1

commit 259f22e
Author: Mikhail Novikov <freiksenet@gmail.com>
Date:   Wed Dec 20 12:42:16 2017 +0200

    Guard against schemas without QueryType (#547)

commit 1e3bb14
Author: Mikhail Novikov <freiksenet@gmail.com>
Date:   Tue Dec 19 14:06:13 2017 +0200

    Check null resolvers

commit 2e2c9b1
Author: Mikhail Novikov <freiksenet@gmail.com>
Date:   Mon Dec 11 16:09:06 2017 +0200

    Simplify API
  • Loading branch information
freiksenet committed Feb 15, 2018
1 parent c758e03 commit 08e2058
Show file tree
Hide file tree
Showing 37 changed files with 2,476 additions and 1,090 deletions.
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
!dist/
!dist/*
!dist/stitching/*
!dist/transforms/*
!package.json
!*.md
!*.png
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"editor.insertSpaces": true,
"editor.rulers": [110],
"editor.wordWrapColumn": 110,
"prettier.semi": true,
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"prettier.singleQuote": true,
Expand Down
30 changes: 28 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,33 @@

### vNEXT

* ...
### v2.19.0

* Also recreate `astNode` property for fields, not only types, when recreating schemas. [PR #580](https://github.com/apollographql/graphql-tools/pull/580)
* Fix `delegateToSchema.js` to accept and move forward args with zero or false values [PR #586](https://github.com/apollographql/graphql-tools/pull/586)

### v2.18.0

* Fix a bug where inline fragments got filtered in merged schemas when a type implemented multiple interfaces [PR #546](https://github.com/apollographql/graphql-tools/pull/546)
* IEnumResolver value can be a `number` type [PR #568](https://github.com/apollographql/graphql-tools/pull/568)

### v2.17.0

* Include `astNode` property in schema recreation [PR #569](https://github.com/apollographql/graphql-tools/pull/569)

### v2.16.0

* Added GraphQL Subscriptions support for schema stitching and `makeRemoteExecutableSchema` [PR #563](https://github.com/apollographql/graphql-tools/pull/563)
* Make `apollo-link` a direct dependency [PR #561](https://github.com/apollographql/graphql-tools/pull/561)
* Update tests to use `graphql-js@0.12` docstring format [PR #559](https://github.com/apollographql/graphql-tools/pull/559)

### v2.15.0

* Validate query before delegation [PR #551](https://github.com/apollographql/graphql-tools/pull/551)

### v2.14.1

* Add guard against invalid schemas being constructed from AST [PR #547](https://github.com/apollographql/graphql-tools/pull/547)

### v2.14.0

Expand Down Expand Up @@ -177,7 +203,7 @@ Update to add support for `graphql@0.12`, and drop versions before `0.11` from t

* Removed testing on Node 5 ([@DxCx](https://github.com/DxCx) in [#129](https://github.com/apollostack/graphql-tools/pull/129))

* Changed GraphQL typings requirment from peer to standard ([@DxCx](https://github.com/DxCx) in [#129](https://github.com/apollostack/graphql-tools/pull/129))
* Changed GraphQL typings requirement from peer to standard ([@DxCx](https://github.com/DxCx) in [#129](https://github.com/apollostack/graphql-tools/pull/129))

* Change the missing resolve function validator to show a warning instead of an error ([@nicolaslopezj](https://github.com/nicolaslopezj) in [#134](https://github.com/apollostack/graphql-tools/pull/134))

Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ type Author {
id: ID! # the ! means that every author object _must_ have an id
firstName: String
lastName: String
posts: [Post] # the list of Posts by this author
"""
the list of Posts by this author
"""
posts: [Post]
}
type Post {
Expand Down
4 changes: 2 additions & 2 deletions designs/connectors.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ In this example, an author has multiple posts, and each post has one author.

Here's an illustration for how connectors and models would look like for this example if Authors and Posts were stored in MySQL, but view counts in MongoDB:

![Connectors are database-specfic, models are application-specific](connector-model-diagram.png)
![Connectors are database-specific, models are application-specific](connector-model-diagram.png)


The Posts model connects to both SQL and MongoDB. Title, text and authorId come from SQL, the view count comes from MongoDB.
Expand All @@ -60,7 +60,7 @@ Both batching and caching are more important in GraphQL than in traditional endp

Models are the glue between connectors - which are backend-specific - and GraphQL types - which are app-specific. They are very similar to models in ORMs, such as Rails' Active Record.

Let's say for example that you have two types, Author and Post, which are both stored in MySQL. Rather than calling the MySQL connector directly from your resolve funcitons, you should create models for Author and Post, which use the MongoDB connector. This additional level of abstraction helps separate the data fetching logic from the GraphQL schema, which makes reusing and refactoring it easier.
Let's say for example that you have two types, Author and Post, which are both stored in MySQL. Rather than calling the MySQL connector directly from your resolve functions, you should create models for Author and Post, which use the MongoDB connector. This additional level of abstraction helps separate the data fetching logic from the GraphQL schema, which makes reusing and refactoring it easier.

In the example schema above, the Authors model would have the following methods:
```
Expand Down
23 changes: 18 additions & 5 deletions docs/source/generate-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ const typeDefs = `
id: Int!
firstName: String
lastName: String
posts: [Post] # the list of Posts by this author
"""
the list of Posts by this author
"""
posts: [Post]
}
type Post {
Expand Down Expand Up @@ -279,19 +282,29 @@ const typeDefs = [`

<h2 id="descriptions">Descriptions &amp; Deprecations</h2>
GraphiQL has built-in support for displaying docstrings with markdown syntax. You can easily add docstrings to types, fields and arguments like below:

```
# Description for the type
"""
Description for the type
"""
type MyObjectType {
# Description for field
"""
Description for field
Supports multi-line description
"""
myField: String!
otherField(
# Description for argument
"""
Description for argument
"""
arg: Int
)
oldField(
# Description for argument
"""
Description for argument
"""
arg: Int
) @deprecated(reason: "Use otherField instead.")
}
Expand Down
2 changes: 1 addition & 1 deletion docs/source/mocking.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Let's take a look at how we can mock a GraphQL schema with just one line of code

[See a complete runnable example on Launchpad.](https://launchpad.graphql.com/98lq7vz8r)

To start, let's grab the schema definition string from the `makeExecutableSchema` example [in the "Generating a schema" article](/tools/graphql-tools/generate-schema.html#example).
To start, let's grab the schema definition string from the `makeExecutableSchema` example [in the "Generating a schema" article](./generate-schema.html#example).

```js
import { makeExecutableSchema, addMockFunctionsToSchema } from 'graphql-tools';
Expand Down
2 changes: 1 addition & 1 deletion docs/source/remote-schemas.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ A link is a function capable of retrieving GraphQL results. It is the same way t
Link API
</h3>

Since graphql-tools supports using a link for the network layer, the API is the same as you would write on the client. To learn more about how Apollo Link works, check out the [docs](https://apollo-links-docs.netlify.com/links); Both GraphQL and Apollo Links have slightly varying concepts of what `context` is used for. To make it easy to use your GraphQL context to create your Apollo Link context, `makeRemoteExecutableSchema` attaches the context from the graphql resolver onto the link context under `graphqlContext`.
Since graphql-tools supports using a link for the network layer, the API is the same as you would write on the client. To learn more about how Apollo Link works, check out the [docs](https://www.apollographql.com/docs/link/); Both GraphQL and Apollo Links have slightly varying concepts of what `context` is used for. To make it easy to use your GraphQL context to create your Apollo Link context, `makeRemoteExecutableSchema` attaches the context from the graphql resolver onto the link context under `graphqlContext`.

Basic usage

Expand Down
6 changes: 3 additions & 3 deletions docs/source/resolvers.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ fieldName(obj, args, context, info) { result }

These arguments have the following meanings and conventional names:

1. `obj`: The object that contains the result returned from the resolver on the parent field, or, in the case of a top-level `Query` field, the `rootValue` passed from the [server configuration](/tools/apollo-server/setup.html). This argument enables the nested nature of GraphQL queries.
1. `obj`: The object that contains the result returned from the resolver on the parent field, or, in the case of a top-level `Query` field, the `rootValue` passed from the [server configuration](/docs/apollo-server/setup.html). This argument enables the nested nature of GraphQL queries.
2. `args`: An object with the arguments passed into the field in the query. For example, if the field was called with `author(name: "Ada")`, the `args` object would be: `{ "name": "Ada" }`.
3. `context`: This is an object shared by all resolvers in a particular query, and is used to contain per-request state, including authentication information, dataloader instances, and anything else that should be taken into account when resolving the query. If you're using Apollo Server, [read about how to set the context in the setup documentation](/tools/apollo-server/setup.html).
3. `context`: This is an object shared by all resolvers in a particular query, and is used to contain per-request state, including authentication information, dataloader instances, and anything else that should be taken into account when resolving the query. If you're using Apollo Server, [read about how to set the context in the setup documentation](/docs/apollo-server/setup.html).
4. `info`: This argument should only be used in advanced cases, but it contains information about the execution state of the query, including the field name, path to the field from the root, and more. It's only documented in the [GraphQL.js source code](https://github.com/graphql/graphql-js/blob/c82ff68f52722c20f10da69c9e50a030a1f218ae/src/type/definition.js#L489-L500).

### Resolver result format
Expand Down Expand Up @@ -178,7 +178,7 @@ Modules and extensions built by the community.

Composition library for GraphQL, with helpers to combine multiple resolvers into one, specify dependencies between fields, and more.

When developing a GraphQL server, it is common to perform some authorization logic on your resolvers, usually based on the context of a request. With `graphql-resolvers` you can easily accomplish that and still make the code decoupled - thus testable - by combining multiple sigle-logic resolvers into one.
When developing a GraphQL server, it is common to perform some authorization logic on your resolvers, usually based on the context of a request. With `graphql-resolvers` you can easily accomplish that and still make the code decoupled - thus testable - by combining multiple single-logic resolvers into one.

The following is an example of a simple logged-in authorization logic:

Expand Down
14 changes: 4 additions & 10 deletions docs/source/scalars.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,8 @@ You can use it in your schema anywhere you could use a scalar:

```graphql
type Query {
# As a return value
favoriteColor: AllowedColor

# As an argument
avatar(borderColor: AllowedColor): String
favoriteColor: AllowedColor # As a return value
avatar(borderColor: AllowedColor): String # As an argument
}
```

Expand Down Expand Up @@ -249,11 +246,8 @@ const typeDefs = `
}
type Query {
# As a return value
favoriteColor: AllowedColor
# As an argument
avatar(borderColor: AllowedColor): String
favoriteColor: AllowedColor # As a return value
avatar(borderColor: AllowedColor): String # As an argument
}
`;

Expand Down
4 changes: 2 additions & 2 deletions docs/source/schema-stitching.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ You won't be able to query `User.chirps` or `Chirp.author` yet however, because

So what should these resolvers look like?

When we resolve `User.chirps` or `Chirp.author`, we want to delegate to the revelant root fields. To get from a user to its chirps for example, we'll want to use the `id` of the user to call `chirpsByAuthorId`. And to get from a chirp to its author, we can use the chirp's `authorId` field to call into `userById`.
When we resolve `User.chirps` or `Chirp.author`, we want to delegate to the relevant root fields. To get from a user to its chirps for example, we'll want to use the `id` of the user to call `chirpsByAuthorId`. And to get from a chirp to its author, we can use the chirp's `authorId` field to call into `userById`.

Resolvers specified as part of `mergeSchema` have access to a `delegate` function that allows you to delegate to root fields.

Expand Down Expand Up @@ -220,7 +220,7 @@ resolvers: mergeInfo => ({

#### mergeInfo and delegate

`mergeInfo` currenty is an object with one property - `delegate`. It looks like this:
`mergeInfo` currently is an object with one property - `delegate`. It looks like this:

```js
type MergeInfo = {
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "graphql-tools",
"version": "2.14.0",
"version": "3.0.0-alpha.5",
"description": "Useful tools to create and manipulate GraphQL schemas.",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down Expand Up @@ -49,34 +49,34 @@
"homepage": "https://github.com/apollostack/graphql-tools#readme",
"dependencies": {
"apollo-utilities": "^1.0.1",
"apollo-link": "^1.0.0",
"deprecated-decorator": "^0.1.6",
"graphql-subscriptions": "^0.5.6",
"uuid": "^3.1.0"
},
"peerDependencies": {
"graphql": "^0.11.0 || ^0.12.0"
},
"devDependencies": {
"@types/chai": "4.0.4",
"@types/chai": "4.0.10",
"@types/graphql": "0.11.7",
"@types/mocha": "^2.2.44",
"@types/node": "^8.0.47",
"@types/uuid": "^3.4.3",
"@types/zen-observable": "^0.5.3",
"apollo-link": "^1.0.0",
"body-parser": "^1.18.2",
"chai": "^4.1.2",
"express": "^4.16.2",
"graphql": "^0.12.3",
"graphql-subscriptions": "^0.5.4",
"graphql-type-json": "^0.1.4",
"istanbul": "^0.4.5",
"iterall": "^1.1.3",
"mocha": "^4.0.1",
"prettier": "^1.7.4",
"remap-istanbul": "0.9.5",
"remap-istanbul": "0.9.6",
"rimraf": "^2.6.2",
"source-map-support": "^0.5.0",
"tslint": "^5.8.0",
"typescript": "2.6.1"
"typescript": "2.6.2"
}
}
37 changes: 36 additions & 1 deletion src/Interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
GraphQLIsTypeOfFn,
GraphQLTypeResolver,
GraphQLScalarType,
GraphQLNamedType,
DocumentNode,
} from 'graphql';

Expand All @@ -29,12 +30,14 @@ export interface IResolverOptions {

export type MergeInfo = {
delegate: (
schemaName: string,
type: 'query' | 'mutation' | 'subscription',
fieldName: string,
args: { [key: string]: any },
context: { [key: string]: any },
info: GraphQLResolveInfo,
) => any;
getSubSchema: (schemaName: string) => GraphQLSchema;
};

export type IFieldResolver<TSource, TContext> = (
Expand All @@ -49,7 +52,7 @@ export type ITypeDefinitions = ITypedef | ITypedef[];
export type IResolverObject = {
[key: string]: IFieldResolver<any, any> | IResolverOptions;
};
export type IEnumResolver = { [key: string]: string };
export type IEnumResolver = { [key: string]: string | number };
export interface IResolvers {
[key: string]:
| (() => any)
Expand Down Expand Up @@ -119,3 +122,35 @@ export interface IMockServer {
vars?: { [key: string]: any },
) => Promise<ExecutionResult>;
}

export type MergeTypeCandidate = {
schemaName: string;
schema?: GraphQLSchema;
type: GraphQLNamedType;
};

export type TypeWithResolvers = {
type: GraphQLNamedType;
resolvers?: IResolvers;
};

export type VisitTypeResult = GraphQLNamedType | TypeWithResolvers | null;

export type VisitType = (
name: string,
candidates: Array<MergeTypeCandidate>,
) => VisitTypeResult;

export type ResolveType<T extends GraphQLType> = (type: T) => T;

export type Operation = 'query' | 'mutation' | 'subscription';

export type Request = {
document: DocumentNode;
variables: Record<string, any>;
extensions?: Record<string, any>;
};

export type Result = ExecutionResult & {
extensions?: Record<string, any>;
};
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export * from './schemaGenerator';
export * from './mock';
export * from './stitching';
export * from './transforms';
Loading

0 comments on commit 08e2058

Please sign in to comment.