ent icon indicating copy to clipboard operation
ent copied to clipboard

error when there's edge conflict isn't that helpful

Open lolopinto opened this issue 1 year ago • 0 comments

e.g. without name: 'articles' at

https://github.com/lolopinto/ent/blob/0c11b175f617a10da89d36e5eebec3e5def94447/examples/simple/src/schema/comment_schema.ts#L23

we get the following error:

tsent codegen
INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
checking for custom graphql definitions...
Error: 
  duplicate graphql field comments in object User
Usage:
  tsent [command]

Available Commands:
  alembic             alembic command
  codegen             runs the codegen (and db schema) migration
  completion          Generate the autocompletion script for the specified shell
  delete_schema       deletes the given schema
  detect_dangling     detects any dangling schema files
  downgrade           downgrade db
  fix-edges           fix edges db
  generate            generate a schema or other object
  help                Help about any command
  migrate_v0.1        migrate v0.1
  print_custom_schema prints the parsed custom graphql schema. only exists for debugging purposes and not guaranteed to exist forever
  print_schema        prints the parsed schema. only exists for debugging purposes and not guaranteed to exist forever
  run_script          run script
  squash              squash last N revs of the db into one
  upgrade             upgrade db

Flags:
      --debug         debug mode. add debug information to codegen e.g. how long commands take
      --debug_files   debug files mode. log files written and not written

Use "tsent [command] --help" for more information about a command.

considering it's a generated edge based on edges being added, difficult to know how to address it.

ForeignKeyEdge.ErrorMessage could be helpful but would also need to change how addEdge works in edge.go

also ^ only addresses common conflicts with edges. if there's conflicts with fields, custom graphql objects etc, not clear how that works

lolopinto avatar May 24 '23 17:05 lolopinto