bx-graphql 0.3.0
Released .
CRUD from a bean
@graphqlCrud( "WidgetService" ) on a bean generates a field for each of get, list, save and delete that service has: widget( id ), widgets, saveWidget( input ) and deleteWidget( id ). @graphqlCrudNames( "list=people" ) renames them. See CRUD from a bean in the README.
- Paging — parameters of the service's
list()namedlimitandoffsetbecomeIntarguments of the list field. - Two classes under
servicePathswith the name a@graphqlCrudgives fail at construction time.
Safer in front of untrusted clients
- Query limits —
maxQueryDepthandmaxQueryComplexityrefuse an oversized query before any resolver runs. - Introspection toggle —
introspection : falserefuses__schemaand__type. - Error masking —
maskErrors : truetells clientsInternal server errorwhen a resolver throws; a function decides which messages pass.onErrorstill receives the real exception. - Guards on properties and hand-written resolvers —
@graphqlRequiresnow works on a bean's properties and on methods of{Type}Resolver.bxclasses.
Also new
operationName— a fourth argument toexecute(), for a document holding several operations.handle( body, context )— runs a GraphQL-over-HTTP request body, as a struct or JSON text; a body that can't be run comes back as an entry inerrors.
Changed
@graphqlRequireson a bean's class now covers its properties as well as its@graphqlFieldfunctions.- The app's context travels in graphql-java's
GraphQLContext. Thecontextargument is unchanged, butenv.getContext()no longer returns it: use the argument, orenv.getGraphQlContext().get( "bxgraphql.context" ).
Housekeeping
- MIT
LICENSEfile, and a GitHub Actions workflow that runs the specs on every push and pull request.