Skip to content

Commit 382c307

Browse files
committed
fixes for graphql consumer
1 parent 3e2c23c commit 382c307

4 files changed

Lines changed: 5 additions & 46 deletions

File tree

pact/pact-react-consumer/package-lock.json

Lines changed: 2 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pact/pact-react-consumer/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
"version": "0.1.0",
44
"private": true,
55
"dependencies": {
6-
"apollo-boost": "^0.1.20",
76
"apollo-cache-inmemory": "^1.3.9",
87
"apollo-client": "^2.4.5",
98
"apollo-link-http": "^1.5.5",

pact/pact-react-consumer/src/graphql/hero.service.graphql.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ import {ApolloClient} from "apollo-client"
22
import {InMemoryCache} from "apollo-cache-inmemory"
33
import {HttpLink} from "apollo-link-http"
44
import gql from "graphql-tag"
5-
import fetch from "node-fetch"
65
import Hero from "../hero";
76

87
class GraphQLHeroService {
98

10-
constructor(baseUrl, port) {
9+
constructor(baseUrl, port, fetch) {
1110
this.client = new ApolloClient({
1211
link: new HttpLink({
1312
uri: `${baseUrl}:${port}/graphql`,

pact/pact-react-consumer/src/graphql/hero.service.test.graphql.pact.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import GraphQLHeroService from './hero.service.graphql';
22
import * as Pact from '@pact-foundation/pact';
3+
import fetch from 'node-fetch';
34

45
describe('HeroService GraphQL API', () => {
56

6-
const heroService = new GraphQLHeroService('http://localhost', global.port);
7+
const heroService = new GraphQLHeroService('http://localhost', global.port, fetch);
78

89
// a matcher for the content type "application/json" in UTF8 charset
910
// that ignores the spaces between the ";2 and "charset"

0 commit comments

Comments
 (0)