Expand my Community achievements bar.

Adobe Summit 2025: AEM Session Recordings Are Live! Missed a session or want to revisit your favorites? Watch the latest recordings now.

Mark Solution

This conversation has been locked due to inactivity. Please create a new post.

"message": "Network error: fetcher is not a function"

Avatar

Community Advisor

I am getting above mentioned error I am using below code snippet to get result from Magento graphql in Node JS:

const gql = require("graphql-tag");
const {ApolloClient} = require("apollo-client");
const fetch = require("node-fetch");
const{createHttpLink} = require("apollo-link-http");
const {InMemoryCache} = require("apollo-cache-inmemory");

const httpLink = createHttpLink({
uri: 'http://localhost:3001/graphql',
fetch: fetch,
});

const client = new ApolloClient({
link: httpLink,
cache: new InMemoryCache(),
});

var queryField = `query {
countries {
id
available_regions {
name
code
}
}
}

`;

const query = gql(queryField);
var variables = {};

const result = client.query({
    query,
    variables
  });

I tried with apollo-client 3 as well as 2.

There seems to be issue in getting the results.

1 Reply

Avatar

Administrator

@arunpatidar  @BrianKasingli @Jaideep_Brar @Andrei_Dantsou  any help on this one? 

 



Kautuk Sahni