fixes for graphql consumer

This commit is contained in:
Tom Hombergs
2018-11-10 11:45:39 +01:00
parent 3e2c23cf45
commit 382c307ae9
4 changed files with 5 additions and 46 deletions

View File

@@ -1674,21 +1674,6 @@
}
}
},
"apollo-boost": {
"version": "0.1.20",
"resolved": "https://registry.npmjs.org/apollo-boost/-/apollo-boost-0.1.20.tgz",
"integrity": "sha512-n2MiEY5IGpD/cy0RH+pM9vbmobM/JZ5qz38XQAUA41FxxMPlLFQxf0IUMm0tijLOJvJJBub3pDt+Of4TVPBCqA==",
"requires": {
"apollo-cache": "1.1.20",
"apollo-cache-inmemory": "1.3.9",
"apollo-client": "2.4.5",
"apollo-link": "1.2.3",
"apollo-link-error": "1.1.1",
"apollo-link-http": "1.5.5",
"apollo-link-state": "0.4.2",
"graphql-tag": "2.10.0"
}
},
"apollo-cache": {
"version": "1.1.20",
"resolved": "https://registry.npmjs.org/apollo-cache/-/apollo-cache-1.1.20.tgz",
@@ -1739,14 +1724,6 @@
"apollo-link": "1.2.3"
}
},
"apollo-link-error": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/apollo-link-error/-/apollo-link-error-1.1.1.tgz",
"integrity": "sha512-/yPcaQWcBdB94vpJ4FsiCJt1dAGGRm+6Tsj3wKwP+72taBH+UsGRQQZk7U/1cpZwl1yqhHZn+ZNhVOebpPcIlA==",
"requires": {
"apollo-link": "1.2.3"
}
},
"apollo-link-http": {
"version": "1.5.5",
"resolved": "https://registry.npmjs.org/apollo-link-http/-/apollo-link-http-1.5.5.tgz",
@@ -1764,15 +1741,6 @@
"apollo-link": "1.2.3"
}
},
"apollo-link-state": {
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/apollo-link-state/-/apollo-link-state-0.4.2.tgz",
"integrity": "sha512-xMPcAfuiPVYXaLwC6oJFIZrKgV3GmdO31Ag2eufRoXpvT0AfJZjdaPB4450Nu9TslHRePN9A3quxNueILlQxlw==",
"requires": {
"apollo-utilities": "1.0.25",
"graphql-anywhere": "4.1.22"
}
},
"apollo-utilities": {
"version": "1.0.25",
"resolved": "https://registry.npmjs.org/apollo-utilities/-/apollo-utilities-1.0.25.tgz",
@@ -3935,7 +3903,7 @@
},
"d": {
"version": "1.0.0",
"resolved": "http://registry.npmjs.org/d/-/d-1.0.0.tgz",
"resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz",
"integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=",
"dev": true,
"requires": {
@@ -5740,14 +5708,6 @@
"iterall": "1.2.2"
}
},
"graphql-anywhere": {
"version": "4.1.22",
"resolved": "https://registry.npmjs.org/graphql-anywhere/-/graphql-anywhere-4.1.22.tgz",
"integrity": "sha512-qm2/1cKM8nfotxDhm4J0r1znVlK0Yge/yEKt26EVVBgpIhvxjXYFALCGbr7cvfDlvzal1iSPpaYa+8YTtjsxQA==",
"requires": {
"apollo-utilities": "1.0.25"
}
},
"graphql-tag": {
"version": "2.10.0",
"resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.10.0.tgz",
@@ -8573,7 +8533,7 @@
},
"next-tick": {
"version": "1.0.0",
"resolved": "http://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz",
"resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.0.0.tgz",
"integrity": "sha1-yobR/ogoFpsBICCOPchCS524NCw=",
"dev": true
},

View File

@@ -3,7 +3,6 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"apollo-boost": "^0.1.20",
"apollo-cache-inmemory": "^1.3.9",
"apollo-client": "^2.4.5",
"apollo-link-http": "^1.5.5",

View File

@@ -2,12 +2,11 @@ import {ApolloClient} from "apollo-client"
import {InMemoryCache} from "apollo-cache-inmemory"
import {HttpLink} from "apollo-link-http"
import gql from "graphql-tag"
import fetch from "node-fetch"
import Hero from "../hero";
class GraphQLHeroService {
constructor(baseUrl, port) {
constructor(baseUrl, port, fetch) {
this.client = new ApolloClient({
link: new HttpLink({
uri: `${baseUrl}:${port}/graphql`,

View File

@@ -1,9 +1,10 @@
import GraphQLHeroService from './hero.service.graphql';
import * as Pact from '@pact-foundation/pact';
import fetch from 'node-fetch';
describe('HeroService GraphQL API', () => {
const heroService = new GraphQLHeroService('http://localhost', global.port);
const heroService = new GraphQLHeroService('http://localhost', global.port, fetch);
// a matcher for the content type "application/json" in UTF8 charset
// that ignores the spaces between the ";2 and "charset"