Skip to content
This repository was archived by the owner on Dec 25, 2025. It is now read-only.
This repository was archived by the owner on Dec 25, 2025. It is now read-only.

[BUG] Cannot run graphql-codegen with fabrixForm directive #169

@IzumiSy

Description

@IzumiSy

Describe the bug

Cannot run graphql-codegen with fabrixForm directive

Steps to reproduce

  1. Write a mutation query that has fabrixForm directive in it.
const App = () => {
  return (
    <FabrixComponent
      containerClassName={containerClassName}
      query={graphql(`
        mutation createTodo($input: TodoInput!) {
          addTodo(input: $input)
            @fabrixForm(
              input: [
                { field: "id", config: { hidden: true } }
                { field: "hasDone", config: { hidden: true } }
                {
                  field: "name"
                  config: { gridCol: 9 }
                  constraint: { maxLength: 50 }
                }
                { field: "priority", config: { gridCol: 3 } }
              ]
            ) {
            id
          }
        }
      `)}
    />
  )
}
  1. Run graphql-codegen
npx graphql-codegen
  1. Get errors
npx graphql-codegen
(node:64109) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
✔ Parse Configuration
⚠ Generate outputs
  ❯ Generate to ./src/graphql/
    ✔ Load GraphQL schemas
    ✔ Load GraphQL documents
    ✖ GraphQL Document Validation failed with 1 errors;
      Error 0: Expected value of type "TodoInput", found [{field: "id", config: {hidden: true}}, {field: "hasDone", config: {hidden: true}}, {field: "name", config: {gridCol: 9}, constraint: {maxLength: 50}}, {field: "priority", config: {gridCol: 3}}].
      at /Users/izumisy/Devs/fabrix-framework/fabrix/examples/vite-todoapp/src/App.tsx:5:24

Expected behavior

No error should be expected.

For fabrixView, no error is thrown on the contrary.

Environment

N/A

Additional context

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions