graphql.schema.idl.FieldWiringEnvironment Java Examples

The following examples show how to use graphql.schema.idl.FieldWiringEnvironment. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RdfWiringFactory.java    From timbuctoo with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean providesDataFetcher(FieldWiringEnvironment environment) {
  return environment.getFieldDefinition().getDirective("fromCollection") != null ||
    environment.getFieldDefinition().getDirective("lookupUri") != null ||
    environment.getFieldDefinition().getDirective("rdf") != null ||
    environment.getFieldDefinition().getDirective("uri") != null ||
    environment.getFieldDefinition().getDirective("passThrough") != null ||
    environment.getFieldDefinition().getDirective("related") != null ||
    environment.getFieldDefinition().getDirective("dataSet") != null ||
    environment.getFieldDefinition().getDirective("entityTitle") != null ||
    environment.getFieldDefinition().getDirective("entityDescription") != null ||
    environment.getFieldDefinition().getDirective("entityImage") != null ||
    environment.getFieldDefinition().getDirective("otherDataSets") != null ||
    environment.getFieldDefinition().getDirective("getAllOfPredicate") != null ||
    environment.getFieldDefinition().getDirective("createMutation") != null ||
    environment.getFieldDefinition().getDirective("editMutation") != null ||
    environment.getFieldDefinition().getDirective("deleteMutation") != null ||
    environment.getFieldDefinition().getDirective("persistEntityMutation") != null ||
    environment.getFieldDefinition().getDirective("setCustomProvenanceMutation") != null ||
    environment.getFieldDefinition().getDirective("resetIndex") != null;
}
 
Example #2
Source File: RdfWiringFactory.java    From timbuctoo with GNU General Public License v3.0 4 votes vote down vote up
@Override
public DataFetcher getDefaultDataFetcher(FieldWiringEnvironment environment) {
  return new PropertyDataFetcher(environment.getFieldDefinition().getName());
}
 
Example #3
Source File: GraphQLExamples.java    From vertx-web with Apache License 2.0 3 votes vote down vote up
public void jsonData() {
  RuntimeWiring.Builder builder = RuntimeWiring.newRuntimeWiring();

  builder.wiringFactory(new WiringFactory() {

    @Override
    public DataFetcher<Object> getDefaultDataFetcher(FieldWiringEnvironment environment) {

      return VertxPropertyDataFetcher.create(environment.getFieldDefinition().getName());

    }
  });
}