question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Module '"../node_modules/@nexus/schema/dist"' has no exported member 'list'

See original GitHub issue

Hello,

I am trying to access the list method from the ‘@nexus/schema’ package, but it is not resolving for me

import { list, objectType, queryType, mutationType, makeSchema, inputObjectType, stringArg } from '@nexus/schema';

Everything except for list seems to be exported fine for me.

Package.json

{
  "name": "with-typescript",
  "version": "1.0.0",
  "scripts": {
    "dev": "next",
    "build": "next build",
    "start": "next start",
    "type-check": "tsc",
    "migrate:save": "prisma migrate save --experimental",
    "migrate:up": "prisma migrate up --experimental",
    "migrate": "yarn migrate:save && yarn migrate:up",
    "postinstall": "prisma generate",
    "generate": "prisma generate"
  },
  "dependencies": {
    "@material-ui/core": "^4.11.0",
    "@material-ui/icons": "^4.9.1",
    "@nexus/schema": "0.14.0",
    "graphql": "^15.3.0",
    "@prisma/client": "^2.11.0",
    "apollo-server-micro": "^2.19.0",
    "axios": "^0.19.2",
    "babel-plugin-styled-components": "^1.11.1",
    "bcrypt": "^5.0.0",
    "classnames": "^2.2.6",
    "cookie": "^0.4.1",
    "graphql-scalars": "^1.5.0",
    "graphql-tag": "^2.11.0",
    "isomorphic-unfetch": "^3.0.0",
    "jsonwebtoken": "^8.5.1",
    "lodash": "^4.17.20",
    "moment": "^2.29.1",
    "next": "latest",
    "next-images": "^1.4.1",
    "next-urql": "^1.1.0",
    "nexus": "^0.26.1",
    "nexus-plugin-prisma": "^0.24.0",
    "nookies": "^2.5.0",
    "react": "^16.12.0",
    "react-dates": "^21.8.0",
    "react-dom": "^16.12.0",
    "react-dropdown": "^1.9.0",
    "react-icons": "^3.11.0",
    "react-is": "^16.13.1",
    "sass": "^1.26.10",
    "styled-components": "^5.1.1",
    "urql": "^1.10.0"
  },
  "devDependencies": {
    "@prisma/cli": "^2.11.0",
    "@types/node": "^12.12.21",
    "@types/react": "^16.9.16",
    "@types/react-dom": "^16.9.4",
    "typescript": "3.7.3"
  },
  "license": "ISC"
}

Is anybody familiar with this problem?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
tgriessercommented, Nov 23, 2020

You can import/add the declarativeWrappingPlugin() to the plugins array in makeSchema config and it will re-enable the previous behavior of nullable / list / required being defined on the object literal, but otherwise the preferred api is:

t.nonNull.string('name')

alias for

t.field('name', { type: nonNull('String') })

and for args

nonNull(stringArg())  // or arg({ type: nonNull('String') }))

The chaining API allows for simpler nested list types:

t.nonNull.list.nonNull.list.nonNull.string() // [[String!]!]!

or if you prefer:

nonNull(list(nonNull(list(nonNull('String')))))
1reaction
jasonkuhrtcommented, Nov 24, 2020

@15chrjef

Regarding the problems with Nexus Plugin Prisma there may be updates needed there, we’ll see. Might take another few days to get it up to date with Nexus 0.19. CC @Weakky

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to solve the "module has no exported member" error?
I am following instructions from the this answer, but cannot make the solution work. import { ViewModel } from "ViewModel"; Module 'C:/DemoApp/app/ViewModel'  ......
Read more >
aws-cdk-lib module - AWS Documentation
When the AWS CDK determines that the resource is in a different stack and is in a different region, it will "export" the...
Read more >
makeSchema - GraphQL Nexus
Defines the GraphQL schema, by combining the GraphQL types defined by the GraphQL ... The type is opaque, it can be an array...
Read more >
prisma type 'number' is not assignable to type 'never' - You.com
import { extendType, objectType } from "nexus"; export const Todo = objectType({ name: "Todo", definition(t) { t.id("id"); t.nonNull.string("title"); t.string( ...
Read more >
Migrating to Apollo Server 4 - Apollo GraphQL Docs
For a list of all breaking changes, see the changelog. ... If there is no Apollo Server integration for your favorite framework yet,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found