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

org.opentripplanner.ext.transmodelapi.model.stop.TariffZoneType Maven / Gradle / Ivy

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

import graphql.Scalars;
import graphql.schema.GraphQLFieldDefinition;
import graphql.schema.GraphQLObjectType;
import graphql.schema.GraphQLTypeReference;
import org.opentripplanner.ext.transmodelapi.support.GqlUtil;
import org.opentripplanner.model.FareZone;

public class TariffZoneType {
  private static final String NAME = "TariffZone";

  public static GraphQLObjectType createTZ() {
    return GraphQLObjectType
        .newObject()
        .name(NAME)
        .field(GqlUtil.newTransitIdField())
        .field(GraphQLFieldDefinition
            .newFieldDefinition()
            .name("name")
            .type(Scalars.GraphQLString)
            .dataFetcher(environment -> ((FareZone) environment.getSource()).getName())
            .build())
        .build();
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy