All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.opentripplanner.ext.transmodelapi.model.framework.InfoLinkType Maven / Gradle / Ivy

There is a newer version: 2.5.0
Show newest version
package org.opentripplanner.ext.transmodelapi.model.framework;

import graphql.Scalars;
import graphql.schema.GraphQLFieldDefinition;
import graphql.schema.GraphQLObjectType;
import org.opentripplanner.routing.alertpatch.AlertUrl;

public class InfoLinkType {

  public static GraphQLObjectType create() {
    return GraphQLObjectType.newObject()
        .name("infoLink")
        .field(GraphQLFieldDefinition.newFieldDefinition()
                .name("uri")
                .type(Scalars.GraphQLString)
                .description("URI")
                .dataFetcher(environment -> {
                    AlertUrl source = environment.getSource();
                    return source.uri;
                })
                .build())
        .field(GraphQLFieldDefinition.newFieldDefinition()
                .name("label")
                .type(Scalars.GraphQLString)
                .description("Label")
                .dataFetcher(environment -> {
                    AlertUrl source = environment.getSource();
                    return source.label;
                })
                .build())
        .build();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy