question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add custom fields to DTO

See original GitHub issue

Is your feature request related to a problem? Please describe. The possibility to add additional property fields to the generated DTO classes which can be used internally by resolvers. These properties should be not available through the GraphQL API.

Describe the solution you’d like An additional setting to specify the properties which are appended to the DTO and the types e.g.

customMappings = [
   "User.internalDate": "java.util.Date"
]

Describe alternatives you’ve considered I searched the current configuration options, but did not find that capability. Is is supported in some way?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
PhilippS93commented, Mar 16, 2021

Thanks, this is working!

I did not consider to separate the generation process and the API provisioning process. It looks a little bit odd to have private API definitions just for the generation process, but it is doing its job.

0reactions
kobylynskyicommented, Mar 16, 2021

Glad it worked!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Which is better adding new fields to existing DTO class or new ...
I would rather consider best design practice that will allow you to maintain your application should you need to add/edit fields in the...
Read more >
Automatically Mapping DTO to Entity on Spring Boot APIs
Let's learn how ModelMapper can help us automate the mapping process of DTOs into entities on Spring Boot APIs.
Read more >
One-Stop Guide to Mapping with MapStruct - Reflectoring
Thus client applications can accept a data object in a custom-defined DTO with required fields. Still, the DTO pattern heavily depends on ...
Read more >
Data Transfer Object (DTO) - Oat++
It is a special object which can be Serialized and Deserialized with the help of oatpp::data::mapping::ObjectMapper. Declaration. Field Name Qualifier; Default ...
Read more >
Why, When and How to Use DTO Projections with JPA and ...
After you defined your DTO class, you can use it as a projection with JPQL, criteria and native queries. For each kind of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found