gqlgen.yml 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. # Where are all the schema files located? globs are supported eg src/**/*.graphqls
  2. schema:
  3. - graph/*.graphqls
  4. # Where should the generated server code go?
  5. exec:
  6. package: graph
  7. layout: single-file # Only other option is "follow-schema," ie multi-file.
  8. # Only for single-file layout:
  9. filename: graph/generated.go
  10. # Only for follow-schema layout:
  11. # dir: graph
  12. # filename_template: "{name}.generated.go"
  13. # Optional: Maximum number of goroutines in concurrency to use per child resolvers(default: unlimited)
  14. # worker_limit: 1000
  15. # Uncomment to enable federation
  16. # federation:
  17. # filename: graph/federation.go
  18. # package: graph
  19. # version: 2
  20. # options:
  21. # computed_requires: true
  22. # Where should any generated models go?
  23. model:
  24. filename: graph/model/models_gen.go
  25. package: model
  26. # Optional: Pass in a path to a new gotpl template to use for generating the models
  27. # model_template: [your/path/model.gotpl]
  28. # Where should the resolver implementations go?
  29. resolver:
  30. package: graph
  31. layout: follow-schema # Only other option is "single-file."
  32. # Only for single-file layout:
  33. # filename: graph/resolver.go
  34. # Only for follow-schema layout:
  35. dir: graph
  36. filename_template: "{name}.resolvers.go"
  37. # Optional: turn on to not generate template comments above resolvers
  38. # omit_template_comment: false
  39. # Optional: Pass in a path to a new gotpl template to use for generating resolvers
  40. # resolver_template: [your/path/resolver.gotpl]
  41. # Optional: turn on to avoid rewriting existing resolver(s) when generating
  42. # preserve_resolver: false
  43. # Optional: turn on use ` + "`" + `gqlgen:"fieldName"` + "`" + ` tags in your models
  44. # struct_tag: json
  45. # Optional: turn on to use []Thing instead of []*Thing
  46. # omit_slice_element_pointers: false
  47. # Optional: turn on to omit Is<Name>() methods to interface and unions
  48. # omit_interface_checks: true
  49. # Optional: turn on to skip generation of ComplexityRoot struct content and Complexity function
  50. # omit_complexity: false
  51. # Optional: turn on to not generate any file notice comments in generated files
  52. # omit_gqlgen_file_notice: false
  53. # Optional: turn on to exclude the gqlgen version in the generated file notice. No effect if `omit_gqlgen_file_notice` is true.
  54. # omit_gqlgen_version_in_file_notice: false
  55. # Optional: turn on to exclude root models such as Query and Mutation from the generated models file.
  56. # omit_root_models: false
  57. # Optional: turn on to exclude resolver fields from the generated models file.
  58. # omit_resolver_fields: false
  59. # Optional: turn off to make struct-type struct fields not use pointers
  60. # e.g. type Thing struct { FieldA OtherThing } instead of { FieldA *OtherThing }
  61. # struct_fields_always_pointers: true
  62. # Optional: turn off to make resolvers return values instead of pointers for structs
  63. # resolvers_always_return_pointers: true
  64. # Optional: turn on to return pointers instead of values in unmarshalInput
  65. # return_pointers_in_unmarshalinput: false
  66. # Optional: wrap nullable input fields with Omittable
  67. # nullable_input_omittable: true
  68. # Optional: set to speed up generation time by not performing a final validation pass.
  69. # skip_validation: true
  70. # Optional: set to skip running `go mod tidy` when generating server code
  71. # skip_mod_tidy: true
  72. # Optional: if this is set to true, argument directives that
  73. # decorate a field with a null value will still be called.
  74. #
  75. # This enables argumment directives to not just mutate
  76. # argument values but to set them even if they're null.
  77. call_argument_directives_with_null: true
  78. # This enables gql server to use function syntax for execution context
  79. # instead of generating receiver methods of the execution context.
  80. # use_function_syntax_for_execution_context: true
  81. # Optional: set build tags that will be used to load packages
  82. # go_build_tags:
  83. # - private
  84. # - enterprise
  85. # Optional: set to modify the initialisms regarded for Go names
  86. # go_initialisms:
  87. # replace_defaults: false # if true, the default initialisms will get dropped in favor of the new ones instead of being added
  88. # initialisms: # List of initialisms to for Go names
  89. # - 'CC'
  90. # - 'BCC'
  91. # gqlgen will search for any type names in the schema in these go packages
  92. # if they match it will use them, otherwise it will generate them.
  93. autobind:
  94. # - "gogs.dmsc.dev/arp/graph/model"
  95. # This section declares type mapping between the GraphQL and go type systems
  96. #
  97. # The first line in each type will be used as defaults for resolver arguments and
  98. # modelgen, the others will be allowed when binding to fields. Configure them to
  99. # your liking
  100. models:
  101. ID:
  102. model:
  103. - github.com/99designs/gqlgen/graphql.ID
  104. - github.com/99designs/gqlgen/graphql.Int
  105. - github.com/99designs/gqlgen/graphql.Int64
  106. - github.com/99designs/gqlgen/graphql.Int32
  107. # gqlgen provides a default GraphQL UUID convenience wrapper for github.com/google/uuid
  108. # but you can override this to provide your own GraphQL UUID implementation
  109. UUID:
  110. model:
  111. - github.com/99designs/gqlgen/graphql.UUID
  112. # The GraphQL spec explicitly states that the Int type is a signed 32-bit
  113. # integer. Using Go int or int64 to represent it can lead to unexpected
  114. # behavior, and some GraphQL tools like Apollo Router will fail when
  115. # communicating numbers that overflow 32-bits.
  116. #
  117. # You may choose to use the custom, built-in Int64 scalar to represent 64-bit
  118. # integers, or ignore the spec and bind Int to graphql.Int / graphql.Int64
  119. # (the default behavior of gqlgen). This is fine in simple use cases when you
  120. # do not need to worry about interoperability and only expect small numbers.
  121. Int:
  122. model:
  123. - github.com/99designs/gqlgen/graphql.Int32
  124. Int64:
  125. model:
  126. - github.com/99designs/gqlgen/graphql.Int
  127. - github.com/99designs/gqlgen/graphql.Int64