Skip to content

Commit

Permalink
Update GraphQL Modules w/ enhancements (#582)
Browse files Browse the repository at this point in the history
* Update GraphQL Modules w/ enhancements

* Fix dependencies

* Fix schema def

* Fix typeDefs merging

* Update GraphQL Modules 0.4.1

* Pin dependencies and add required core-js version to fix apollo-server

* Fix tests

* Try lowercase headerName if it doesn't exist

* Fix lock files

Signed-off-by: Arda TANRIKULU <[email protected]>

* skipLibCheck in react-rest-typescript

Signed-off-by: Arda TANRIKULU <[email protected]>

* Use latest node version

* Revert jest version

* Fix lock file

* Fix typing

* Add skipLibCheck to graphql-server-typescript

* Implement userFieldsFragment support

Signed-off-by: Arda TANRIKULU <[email protected]>

* remove skipLibCheck and update GraphQL Modules version

* Remove resolutions field in e2e

* Remove skipLibCheck from examples and use tslib instead of duplicating polyfills

* Remove unnecessary jest

* Fix netlify build
  • Loading branch information
ardatan authored and pradel committed Feb 6, 2019
1 parent 7f1f125 commit 6fdec83
Show file tree
Hide file tree
Showing 95 changed files with 8,542 additions and 7,269 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ website/build/
website/node_modules
website/i18n/*
docs/api
build/
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ These variables should then be referenced when creating your GraphQL server.
```javascript
import accountsBoost, { authenticated } from '@accounts/boost';
import { ApolloServer } from 'apollo-server';
import { mergeGraphQLSchemas, mergeResolvers } from '@graphql-modules/epoxy';
import { mergeGraphQLSchemas, mergeResolvers } from 'graphql-toolkit';

(async () => {
const accounts = (await accountsBoost({
Expand Down Expand Up @@ -190,11 +190,11 @@ const accountsServerUri = 'http://localhost:4003/';
if (!previousContext.graphqlContext) {
return {};
}
// Attach the accounts-access-token to requests which are proxied to the remote schema.
// Attach the Authorization to requests which are proxied to the remote schema.
// This step is optional and only required if you want the `getUser` query to return data.
return {
headers: {
'accounts-access-token': previousContext.graphqlContext.authToken,
Authorization: 'Bearer ' + previousContext.graphqlContext.authToken,
},
};
}).concat(http);
Expand Down
4 changes: 2 additions & 2 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,11 @@ const accountsServerUri = 'http://localhost:4003/';
if (!previousContext.graphqlContext) {
return {};
}
// Attach the accounts-access-token to requests which are proxied to the remote schema.
// Attach the Authorization to requests which are proxied to the remote schema.
// This step is optional and only required if you want the `getUser` query to return data.
return {
headers: {
'accounts-access-token': previousContext.graphqlContext.authToken,
Authorization: 'Bearer ' + previousContext.graphqlContext.authToken,
},
};
}).concat(http);
Expand Down
26 changes: 13 additions & 13 deletions examples/accounts-boost/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@
"test": "yarn build"
},
"dependencies": {
"@accounts/boost": "^0.7.0",
"@graphql-modules/epoxy": "^0.2.15",
"apollo-link-context": "^1.0.10",
"apollo-link-http": "^1.5.7",
"apollo-server": "^2.2.3",
"graphql": "^14.0.2",
"graphql-tools": "^4.0.3",
"@accounts/boost": "^0.9.3",
"graphql-toolkit": "^0.0.5",
"apollo-link-context": "^1.0.14",
"apollo-link-http": "^1.5.11",
"apollo-server": "^2.3.3",
"graphql": "^14.1.1",
"graphql-tools": "^4.0.4",
"lodash": "^4.17.11",
"node-fetch": "^2.3.0"
"node-fetch": "^2.3.0",
"tslib": "1.9.3"
},
"devDependencies": {
"@accounts/tslint-config-accounts": "^0.0.9",
"@types/node": "10.12.10",
"nodemon": "1.18.7",
"ts-node": "7.0.1",
"tslint": "^5.11.0",
"typescript": "3.1.6"
"nodemon": "1.18.9",
"ts-node": "8.0.2",
"tslint": "^5.12.1",
"typescript": "3.3.1"
}
}
9 changes: 3 additions & 6 deletions examples/accounts-boost/src/microservice/app-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ const accountsServerUri = 'http://localhost:4003/';
if (!previousContext.graphqlContext) {
return {};
}
// Attach the accounts-access-token to requests which are proxied to the remote schema.
// Attach the Authorization to requests which are proxied to the remote schema.
// This step is optional and only required if you want the `getUser` query to return data.
return {
headers: {
'accounts-access-token': previousContext.graphqlContext.authToken,
Authorization: 'Bearer ' + previousContext.graphqlContext.authToken,
},
};
}).concat(http);
Expand Down Expand Up @@ -92,10 +92,7 @@ const accountsServerUri = 'http://localhost:4003/';
const apolloServer = await new ApolloServer({
schema: mergeSchemas({
schemas: [executableLocalSchema, executableRemoteSchema],
schemaDirectives: {
// In order for the `@auth` directive to work
...accounts.schemaDirectives,
},
schemaDirectives: accounts.schemaDirectives as any,
}),
context: ({ req }) => accounts.context({ req }),
}).listen();
Expand Down
2 changes: 1 addition & 1 deletion examples/accounts-boost/src/monolithic/app-server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import accountsBoost, { authenticated } from '@accounts/boost';
import { mergeGraphQLSchemas, mergeResolvers } from '@graphql-modules/epoxy';
import { mergeGraphQLSchemas, mergeResolvers } from 'graphql-toolkit';
import { ApolloServer } from 'apollo-server';

(async () => {
Expand Down
4 changes: 3 additions & 1 deletion examples/accounts-boost/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
"outDir": "./lib",
"target": "es5",
"lib": ["es2015", "esnext.asynciterable"],
"sourceMap": true
"sourceMap": true,
"importHelpers": true,
"esModuleInterop": true
},
"include": ["./src/**/*"],
"exclude": ["node_modules", "lib"]
Expand Down
Loading

0 comments on commit 6fdec83

Please sign in to comment.