ardatan/graphql-import

#import * from 'prisma-schema.graphql' Not Importing Anything. Specific Types Not Importing.

Closed this issue · 4 comments

I'm trying to import all types from my prisma schema, however nothing actually imports.
image

Here is the output.
image

If I try to import a specific type, such as an input type called UserUpdateInputit will not specifically import UserUpdateInput. It will only import every type that is similar such as UserUpdateManyDataInput, UserUpdateManyMutationInput, UserUpdateManyWithoutRolesInput, etc...

Here is the start of my prisma-schema.graphql file for reference/example.
image

Am I misinterpreting anything?

package.json

{
  "name": "my-app",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "build": "prisma generate && prisma deploy && tsc",
    "start": "cd ./dist/apollo && node index.js",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "apollo-server": "^2.4.8",
    "bcrypt": "^3.0.6",
    "dotenv": "^7.0.0",
    "graphql-cli": "^3.0.11",
    "graphql-import": "^0.7.1",
    "graphql-tools": "^4.0.4",
    "jsonwebtoken": "^8.5.1",
    "lodash": "^4.17.11",
    "prisma": "^1.31.1",
    "prisma-binding": "^2.3.10",
    "prisma-client-lib": "^1.31.1"
  },
  "devDependencies": {
    "@types/bcrypt": "^3.0.0",
    "@types/dotenv": "^6.1.1",
    "@types/graphql": "^14.2.0",
    "@types/jsonwebtoken": "^8.3.2",
    "@types/lodash": "^4.14.123",
    "@typescript-eslint/eslint-plugin": "^1.7.0",
    "@typescript-eslint/parser": "^1.7.0",
    "eslint": "^5.16.0",
    "eslint-config-prettier": "^4.1.0",
    "eslint-plugin-prettier": "^3.0.1",
    "prettier": "^1.17.0",
    "typescript": "^3.4.4"
  },
  "resolutions": {
    "graphql": "^0.13.1",
    "c/**/left-pad": "1.1.2"
  }
}

Hey,

I just spent a better part of a day with the same issue, apparently, you need to reference what you want to import. so try _empty: acl

There should probably be a warning if your import statement doesn't have anything referenced.

Hi @Flash619 @mrfrase3
In 1.0.0 beta release, we introduced a lot of changes including the support to import specific types other than root types.
Could you install graphql-import@beta to try new changes? Don't forget to modify your code regarding to the migration notes in README.
https://github.com/ardatan/graphql-import#updating-from-07x

Let us know if your issue still persists.

@ardatan
This issue still happens with beta version.

Available in 1.0.0!