public static GraphQLFieldDefinition field ( String fieldName , String tableName ) { return newFieldDefinition ( ) . name ( fieldName ) . type ( GraphQLInt ) . dataFetcher ( new RowCountFetcher ( tableName ) ) . build ( ) ; }
Convenience method to create a field in a GraphQL schema that fetches the number of rows in a table . Must be on a type that has a namespace field for context .