leangen / graphql-spqr

Build a GraphQL service in seconds
Apache License 2.0
1.09k stars 179 forks source link

static fields should be omitted from generated schema #436

Closed Fuud closed 1 year ago

Fuud commented 1 year ago

Static fields (and methods) should not be included in schema.

For example it fixes #390 Also it will help use existing domain model (not annotated with spqr annotations). For example, if it contains fields like static serialVersionUid.

kaqqao commented 1 year ago

I don't like that this changes the behavior in a compatibility-breaking way, and assumes no one will ever want statics exposed. Instead, I suggest you add a new InclusionStrategy (probably inheriting the default one). That way it's a simple one-liner for those who wish to exclude statics and doesn't interfere with anyone using the default strategy.

Interested in making that change?

kaqqao commented 1 year ago

Fixed in https://github.com/leangen/graphql-spqr/issues/460