Exemplo n.º 1
0
class PullRequest(Type):
    number = int
    title = str
    body_text = str
    author = Actor
    created_at = DateTime
    last_edited_at = DateTime
    closed = bool
    closed_at = DateTime
    milestone = Milestone
    state = PullRequestState
    url = str
    labels = Field(LabelConnection, args=connection_args())
    assignees = Field(ActorConnection, args=connection_args())
    comments = Field(IssueCommentConnection, args=connection_args())
    project_cards = Field(ProjectCardConnection, args=connection_args())

    additions = int
    deletions = int
    head_ref_name = str
    merged = bool
    merged_at = DateTime
    reviews = Field(PullRequestReviewConnection,
                    args=connection_args(states=list_of(
                        non_null(PullRequestReviewState)), ))
Exemplo n.º 2
0
class Query(Type):
    node = Field(Node, args={'id': non_null(id)})
    repository = Field(Repository,
                       args={
                           'name': non_null(str),
                           'owner': non_null(str),
                       })
Exemplo n.º 3
0
class Query(Type):
    facilities = Field(FacilitiesConnection)
    metric_labels = Field(non_null(list_of(non_null(MetricLabel))),
                          graphql_name="metricLabels")
    metric_data = Field(
        MetricDataConnection,
        graphql_name="metricData",
        args={
            "source_id": Arg(non_null(str),
                             graphql_name="sourceId",
                             default=None),
            "label": Arg(non_null(str), graphql_name="label", default=None),
        },
    )
Exemplo n.º 4
0
    class NestedThing(Input):
        __schema__ = schema
        nested_value = Field(String)
        nested_enum = Field(TestEnum)

        @staticmethod
        def create(nested_value, nested_enum):
            return NestedThing(json_data={k: v for k, v in {
                'nested_value': nested_value.__to_internal_json_value__()
                if getattr(nested_value, '__to_internal_json_value__', None)
                else nested_value,
                'nested_enum': nested_enum.__to_internal_json_value__()
                if getattr(nested_enum, '__to_internal_json_value__', None)
                else nested_enum,
            }.items() if k and v})
Exemplo n.º 5
0
class Issue(Type, Node):
    number = int
    title = str
    body_text = str
    author = Actor
    created_at = DateTime
    last_edited_at = DateTime
    closed = bool
    closed_at = DateTime
    milestone = Milestone
    state = IssueState
    url = str
    labels = Field(LabelConnection, args=connection_args())
    assignees = Field(ActorConnection, args=connection_args())
    comments = Field(IssueCommentConnection, args=connection_args())
    project_cards = Field(ProjectCardConnection, args=connection_args())
Exemplo n.º 6
0
class Query(Type):
    plan = Field(Plan,
                 args={
                     'from': Location,
                     'to': Location,
                     'num_itineraries': int
                 })
Exemplo n.º 7
0
class Facility(Type, Node):
    id = Field(non_null(Int), graphql_name="id")
    name = Field(non_null(String), graphql_name="name")
    slug = Field(non_null(String), graphql_name="slug")
    address = Field(String, graphql_name="address")
    city = Field(String, graphql_name="city")
    state = Field(String, graphql_name="state")
    zip = Field(String, graphql_name="zip")
    timezone_name = Field(String, graphql_name="timezoneName")
Exemplo n.º 8
0
class PullRequestReview(Type):
    author = Actor
    body_text = str
    created_at = DateTime
    last_edited_at = DateTime
    state = PullRequestReviewState
    url = str
    comments = Field(PullRequestReviewCommentConnection,
                     args=connection_args())
Exemplo n.º 9
0
    class InputThing(Input):
        __schema__ = schema
        nest = Field(NestedThing)

        @staticmethod
        def create(nest):
            return InputThing(json_data={k: v for k, v in {
                'nest': nest.__to_internal_json_value__()
                if getattr(nest, '__to_internal_json_value__', None) else nest,
            }.items() if k and v})
Exemplo n.º 10
0
class Repository(Type, Node):
    issues = Field(IssueConnection,
                   args=connection_args(
                       labels=list_of(non_null(str)),
                       order_by=IssueOrder,
                       states=list_of(non_null(IssueState)),
                   ))
    pull_requests = Field(PullRequestConnection,
                          args=connection_args(
                              labels=list_of(non_null(str)),
                              order_by=IssueOrder,
                              states=list_of(non_null(PullRequestState)),
                          ))
    labels = Field(LabelConnection, args=connection_args())
    milestones = Field(MilestoneConnection, args=connection_args())
    projects = Field(ProjectConnection, args=connection_args())
    isPrivate = bool
    name = str
    name_with_owner = str
    url = str
Exemplo n.º 11
0
class Home(Type):
    id = ID
    current_subscription = Field(Subscription)
Exemplo n.º 12
0
class Subscription(Type):
    price_info = Field(PriceInfo)
Exemplo n.º 13
0
class PriceInfo(Type):
    current = Field(Price)
    today = list_of(Price)
    tomorrow = list_of(Price)
Exemplo n.º 14
0
class Query(Type):  # GraphQL's root
    repository = Field(Repository, args={'owner': str, 'name': str})
Exemplo n.º 15
0
class Repository(Type):
    issues = Field(IssueConnection, args=connection_args())
Exemplo n.º 16
0
class CreateFacilityInput(Input):
    facility = Field(non_null("FacilityInput"), graphql_name="facility")
Exemplo n.º 17
0
class CreateFacilityPayload(Type):
    facility = Field("Facility", graphql_name="facility")
Exemplo n.º 18
0
class Mutation(Type):
    create_facility = Field(
        CreateFacilityPayload,
        graphql_name="createFacility",
        args={"input": Arg(non_null(CreateFacilityInput))},
    )
Exemplo n.º 19
0
class MetricData(Type, Node):
    time = non_null(str)
    source_id = Field(non_null(str), graphql_name="sourceId")
    label = str
    data = str
    metadata = str
Exemplo n.º 20
0
class Query(Type):
    missions = Field(MissionNode)
Exemplo n.º 21
0
class Viewer(Type):
    homes = list_of(Home)
    home = Field(Home)
Exemplo n.º 22
0
class User(Type):
    following = Field(FollowingConnection, args=connection_args())
    followers = Field(FollowersConnection, args=connection_args())
Exemplo n.º 23
0
class Query(Type):
    """Subset of Graphql query type."""

    phraseGroup = Field(PhraseGroup, args=ArgDict(eid=str))
Exemplo n.º 24
0
class Query(Type):  # GraphQL's root
    user = Field(User, args={'login': str})
    viewer = Field(Viewer)
Exemplo n.º 25
0
class Query(Type):  # GraphQL's root
    viewer = Field(Viewer)
Exemplo n.º 26
0
 class Query(Type):
     __schema__ = schema
     thing = Field(String,
                   args=ArgDict((('param_value', Arg(InputThing)),)))