Skip to content

Templates more flexible #1327

@MartyWind

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.

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