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

org.opentripplanner.ext.transmodelapi.model.network.PresentationType Maven / Gradle / Ivy

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

import graphql.Scalars;
import graphql.schema.GraphQLFieldDefinition;
import graphql.schema.GraphQLObjectType;
import org.opentripplanner.model.Route;

public class PresentationType {

  public static GraphQLObjectType create() {
  return GraphQLObjectType.newObject()
          .name("Presentation")
          .description("Types describing common presentation properties")
          .field(GraphQLFieldDefinition.newFieldDefinition()
                  .name("colour")
                  .type(Scalars.GraphQLString)
                  .dataFetcher(environment -> ((Route) environment.getSource()).getColor())
                  .build())
          .field(GraphQLFieldDefinition.newFieldDefinition()
                  .name("textColour")
                  .type(Scalars.GraphQLString)
                  .dataFetcher(environment -> ((Route) environment.getSource()).getTextColor())
                  .build())
          .build();
}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy