Skip to content

Commit 173d90a

Browse files
committed
Update graphql-tools
1 parent 9160664 commit 173d90a

File tree

3 files changed

+16
-21
lines changed

3 files changed

+16
-21
lines changed

README.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[![scalar](https://user-images.githubusercontent.com/25294569/63675022-87723c80-c7f0-11e9-87b9-22c78c9a17e2.gif)](http://the-guild.dev)
22

3-
43
[![npm version](https://badge.fury.io/js/graphql-scalars.svg)](https://badge.fury.io/js/graphql-scalars)
54
[![Discord Chat](https://img.shields.io/discord/625400653321076807)](https://discord.gg/xud7bH9)
65

@@ -238,7 +237,7 @@ These scalars can be used just like the base, built-in ones.
238237

239238
```javascript
240239
import { ApolloServer } from 'apollo-server';
241-
import { makeExecutableSchema } from 'graphql-tools';
240+
import { makeExecutableSchema } from '@graphql-tools/schema';
242241
// import all scalars and resolvers
243242
import { typeDefs, resolvers } from 'graphql-scalars';
244243
// Alternatively, import individual scalars and resolvers
@@ -272,7 +271,7 @@ server.listen().then(({ url }) => {
272271

273272
```javascript
274273
import { ApolloServer } from 'apollo-server';
275-
import { makeExecutableSchema } from 'graphql-tools';
274+
import { makeExecutableSchema } from '@graphql-tools/schema';
276275
// import all scalars and resolvers
277276
import { typeDefs, resolvers, mocks } from 'graphql-scalars';
278277
// Alternatively, import individual scalars and resolvers
@@ -299,7 +298,7 @@ const server = new ApolloServer({
299298
// DateTimeMock,
300299
// ...
301300
// ... other mocks ...
302-
}
301+
},
303302
});
304303
```
305304

@@ -311,10 +310,7 @@ const { ApolloServer } = require('apollo-server-express');
311310
const { DateTimeResolver, DateTimeTypeDefinition } = require('graphql-scalars');
312311

313312
const server = new ApolloServer({
314-
typeDefs: [
315-
DateTimeTypeDefinition,
316-
...yourTypeDefs,
317-
],
313+
typeDefs: [DateTimeTypeDefinition, ...yourTypeDefs],
318314
resolvers: [
319315
{ DateTime: DateTimeResolver }, // <-- Notable difference here
320316
...yourResolvers,
@@ -326,7 +322,6 @@ server.listen().then(({ url }) => {
326322
});
327323
```
328324

329-
330325
### Using the RegularExpression scalar
331326

332327
First an explanation: To create a new scalar type to the GraphQL schema language, you must create an
@@ -520,6 +515,7 @@ In the future we might expand this list and use the more comprehensive list foun
520515
A long integer type for [graphql-js](https://github.com/graphql/graphql-js). This implementation gives you more than 32 bits rather than the default 32-bit GraphQLInt. [It uses native `BigInt` implementation of JavaScript.](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt)
521516
The [GraphQL spec](https://facebook.github.io/graphql/#sec-Int) limits its Int type to 32-bits. Maybe you've seen this error before:
522517
[Issue on graphql-js](https://github.com/graphql/graphql-js/issues/292)
518+
523519
```
524520
GraphQLError: Argument "num" has invalid value 9007199254740990.
525521
Expected type "Int", found 9007199254740990.
@@ -541,7 +537,7 @@ A field whose value is a [hex color code](https://en.wikipedia.org/wiki/Web_colo
541537

542538
### HSL
543539

544-
A field whose value is a [CSS HSL color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#hsl()_and_hsla()).
540+
A field whose value is a [CSS HSL color](<https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#hsl()_and_hsla()>).
545541

546542
### IPv4
547543

@@ -565,15 +561,15 @@ A field whose value is a valid [TCP port](https://en.wikipedia.org/wiki/Transmis
565561

566562
### RGB
567563

568-
A field whose value is a [CSS RGB color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#rgb()_and_rgba()).
564+
A field whose value is a [CSS RGB color](<https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#rgb()_and_rgba()>).
569565

570566
### RGBA
571567

572-
A field whose value is a [CSS RGBA color](https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#rgb()_and_rgba()).
568+
A field whose value is a [CSS RGBA color](<https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#rgb()_and_rgba()>).
573569

574570
### USCurrency
575571

576-
A US currency string, such as $21.25.
572+
A US currency string, such as \$21.25.
577573

578574
> Uses [graphql-currency-scalars](https://github.com/abhiaiyer91/graphql-currency-scalars)
579575

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@
4040
"bundlesize": "yarn build && cd bundle-test/ && yarn && yarn test"
4141
},
4242
"devDependencies": {
43-
"bob-the-bundler": "1.0.2",
43+
"@graphql-tools/merge": "6.0.1",
44+
"@graphql-tools/schema": "6.0.1",
4445
"@types/jest": "25.2.3",
4546
"@types/node": "13.13.9",
47+
"bob-the-bundler": "1.0.2",
4648
"graphql": "15.0.0",
47-
"graphql-tools": "5.0.0",
4849
"husky": "4.2.5",
4950
"jest": "26.0.1",
5051
"lint-staged": "10.2.6",
51-
"merge-graphql-schemas": "1.7.8",
5252
"prettier": "2.0.5",
5353
"semver": "7.3.2",
5454
"ts-jest": "26.0.0",

tests/Common.test.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import { makeExecutableSchema } from 'graphql-tools';
1+
import { makeExecutableSchema } from '@graphql-tools/schema';
22
import {
33
typeDefs as scalarTypeDefs,
44
resolvers as scalarResolvers,
55
} from '../src';
6-
import { mergeTypes } from 'merge-graphql-schemas';
7-
import { mergeResolvers } from 'merge-graphql-schemas';
6+
import { mergeTypeDefs, mergeResolvers } from '@graphql-tools/merge';
87
import { GraphQLSchema, graphql } from 'graphql';
98

109
const FOO = { bar: 'QUX' };
@@ -19,8 +18,8 @@ const fooResolvers = {
1918
},
2019
};
2120

22-
const typeDefs = mergeTypes([fooQuery, ...scalarTypeDefs]);
23-
const resolvers = mergeResolvers([fooResolvers, scalarResolvers as any]);
21+
const typeDefs = mergeTypeDefs([fooQuery, ...scalarTypeDefs]);
22+
const resolvers = mergeResolvers([fooResolvers, scalarResolvers]);
2423

2524
describe('Common', () => {
2625
it('should create a valid schema', async () => {

0 commit comments

Comments
 (0)