Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
IzumiSy opened this issue Jan 29, 2025 · 0 comments
Open

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

IzumiSy opened this issue Jan 29, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@IzumiSy
Copy link
Member

IzumiSy commented Jan 29, 2025

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

@IzumiSy IzumiSy added the bug Something isn't working label Jan 29, 2025
@IzumiSy IzumiSy changed the title [BUG] [BUG] Cannot run graphql-codegen with fabrixForm directive Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant