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

Bad imports for enums #52

Open
drkgreyhawk opened this issue Sep 5, 2024 · 1 comment
Open

Bad imports for enums #52

drkgreyhawk opened this issue Sep 5, 2024 · 1 comment

Comments

@drkgreyhawk
Copy link

drkgreyhawk commented Sep 5, 2024

While using a schema with an enum table titled ability_categories I get some strange imports in the file InsertAbilityOne.elm after running a npx elm-gql init --force.

Notice the import import Api.Enum.ability_categories_enum is a 'bad' import. Both imports seem to be used throughout the file at various locations.

InsertAbilityOne.elm imports

import Api
import Api.Enum.Ability_categories_enum
import Api.Enum.ability_categories_enum
import GraphQL.Decode
import GraphQL.Engine
import GraphQL.InputObject
import Json.Decode
import Json.Encode

The GraphQL

mutation InsertAbilityOne(
  $name: String!
  $description: String!
  $fx: String!
  $category: ability_categories_enum!
) {
  insert_abilities_one(
    object: {
      name: $name
      description: $description
      fx: $fx
      category: $category
    }
  ) {
    name
    description
    fx
    category
  }
}

This is replicated anytime I use an enum table with similar naming patterns. It can be fixed by replacing the bad import with the correct import and removing the bad import.

Replicated while using version 0.14.0 & 0.13.0

@drkgreyhawk
Copy link
Author

It looks like every enum is resulting in a 'bad import'. I have over 100 generated files in api/ and it looks like every file that has an enum reference has this 'bad import'

import Api.Enum.Cursor_ordering
import Api.Enum.cursor_ordering
import Api.Input
import Dict
import GraphQL.InputObject
import Json.Decode
import Json.Encode

@drkgreyhawk drkgreyhawk changed the title A bad import while using an enum table generated using init --force A bad imports for enums Nov 27, 2024
@drkgreyhawk drkgreyhawk changed the title A bad imports for enums Bad imports for enums Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant