Skip to content

Templates more flexible #1327

Closed
Closed

Description

@MartyWind

Is your feature request related to a problem? Please describe.
I want to generate more than just XyzResolver interfaces.
Like XyzResolverImpl and XyzService interfaces.

Describe the solution you'd like

  1. A few more variables in the templates.
  • The className without the suffix.
  • The type of the operation (Mutation, Query, Subscription), so I can generate the @SchemaMapping annotation.
  1. A way to generate these into their own files and directories.

Current workarounds

  1. I can split the current className by using ?keep_before("Resolver"). That works but bloats the template, since that's done in numerous places.
    But generating the @SchemaMapping is currently impossible I think, as I have no way of knowing the type.

  2. Currently I just have them in one file. That's not so bad and is not a priority, but it would be very nice to expand this even further in the future, so that eg. the service interfaces lie in their own package. A generic mechanism would be awesome so you could generate variable amounts of files into variable directories without having them hard coded as model and api.

Activity

  1. changed the title [-]Template variables more fine grained[/-] [+]Templates more flexible[/+] on Sep 6, 2023
  2. MartyWind commented on Sep 11, 2023

    @MartyWind
    Author

    To 1:
    I can also work around that by checking if the name of the generated class contains Mutation or Query.

    So for now I can do everything I want, but more flexibility, especially regarding the generated files, would be nice.

  3. Repository owner locked and limited conversation to collaborators on Nov 9, 2023
  4. converted this issue into a discussion #1386 on Nov 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions