Skip to content

Node.JS Modules: TypeError: GraphQLJSClient is not a constructor #176

@SunboX

Description

@SunboX

Hi,

I'm importing the client like this:

import GraphQLJSClient from 'graphql-js-client'


const graphQLClient = new GraphQLJSClient(types, {
    fetcher: function fetcher(graphQLParams) {
        return fetch(url, {
            body: JSON.stringify(graphQLParams),
            method: 'POST',
            mode: 'cors',
            headers
        }).then((response) => response.json());
    }
})

inside a *.mjs file. But I'm getting the exception in the subject.

node index.mjs
TypeError: GraphQLJSClient is not a constructor

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions