Skip to content

Error when attempting to use GraphQLRequest #11

Description

@0gust1

Linked to #9

In version 5.1.1, when attempting to use GraphQLRequestin our server-side code:

import {GraphQLRequest} from "@rcsb/rcsb-api-tools/lib/RcsbGraphQL/GraphQLRequest";

We get this error:

Cannot find module '/<PROJECT_FOLDER>/node_modules/@rcsb/rcsb-api-tools/lib/RcsbLocalStorage/LocalStorageTools' imported from /<PROJECT_FOLDER>/node_modules/@rcsb/rcsb-api-tools/lib/RcsbGraphQL/GraphQLRequest.js

It should be noted that it worked before (v4.3.1) (and LocalStorageTools was already present in this version).

It seems that some changes in package configuration confuses bundlers, and then are unable to resolve the import {LocalStorageTools as LST} from "../RcsbLocalStorage/LocalStorageTools" directive in src/RcsbGraphQL/GraphQLRequest.ts.

If we attempt to use the commonJS version:

import pkg from '@rcsb/rcsb-api-tools';
const {GraphQLRequest} = pkg;

const RCSBGraphQLClient = new GraphQLRequest('sequence-coordinates', { fetch: fetch });
// ...code

we get an Error: GraphQLRequest is not a constructor

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions