8000 Critical dependency: the request of a dependency is an expression · Issue #1170 · graphql-nexus/nexus · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Critical dependency: the request of a dependency is an expression #1170
Open
@dieg092

Description

@dieg092

Hello, it's my first time implementing nexus in nextjs 14 project. My configuration works fine but one warning is shown when /api/graphql is requested.

This is my configuration. I dont know how to fix it. Some idea?

Warning:
Screenshot 2024-03-21 at 15 07 17

Dependences:
Screenshot 2024-03-21 at 15 07 40

/api/graphql/route.ts:
Screenshot 2024-03-21 at 15 08 38

Schema.ts:

import {
    arg,
    enumType,
    intArg,
    interfaceType,
    makeSchema,
    objectType,
    queryType,
    stringArg,
    list,
} from 'nexus'

const Node = interfaceType({
    name: 'Node',
    definition(t) {
      t.id('id', { description: 'GUID for a resource' })
    },
    resolveType(data) {
        if (data.hasOwnProperty('username') && data.hasOwnProperty('email')) {
            return 'Account';
        }
        return null;
    }
  })
  

const Account = objectType({
    name: 'Account',
    definition(t) {
        t.implements(Node) 
        t.string('username')
        t.string('email')
    },
})

const StatusEnum = enumType({
    name: 'StatusEnum',
    members: ['ACTIVE', 'DISABLED'],
})

const Query = queryType({
    definition(t) {
        t.field('account', {
            type: Account, 
            args: {
                name: stringArg(),
                status: arg({ type: 'StatusEnum' }),
            },
        })
        t.field('accountsById', {
            type: list(Account),
            args: {
                ids: list(intArg()),
            },
        })
    },
})

const schema = makeSchema({
    types: [Account, Node, Query, StatusEnum],
})

export default schema

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

      0