Skip to content

GraphQL Error: "message": "options.ctr is not a constructor" when using fieldEdge? #1782

@ashleyxue529

Description

@ashleyxue529

Setup is like this:

UserSchema:
...
 fields: {
    foodID: UUIDType({
      fieldEdge: { schema: "Food", inverseEdge: "users" },
    }),
...

FoodSchema:
...
edges: [
    {
      name: "users",
      schemaName: "User",
    },

Codegen is successful, but I think some files/naming is missing/incorrect? When running the query in GraphiQL, it produces the error "message": "options.ctr is not a constructor". I saw that in user_to_foods_connection_type.ts, UserToFoodsEdge is missing:

import { UserToFoodsEdge } from "src/ent/";

Am I missing something in my setup?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions