class Query(Type): node = Field(Node, args={'id': non_null(id)}) repository = Field(Repository, args={ 'name': non_null(str), 'owner': non_null(str), })
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")
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), }, )
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)), ))
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
def main(size, after, url, username, password): """Console script for srgssr_publication_data_api.""" variables = {'first': size} if after: variables['after'] = after client = PublicationDataApi(url, username, password) op = client.query_op(first=non_null(int), after=str) op.faro_items(first=Variable('first'), after=Variable('after')) print(f"Executing GraphQL Query: {op}") result=client.run_query(op, variables) if result: print(result) return 0 else: return 1
class Mutation(Type): create_facility = Field( CreateFacilityPayload, graphql_name="createFacility", args={"input": Arg(non_null(CreateFacilityInput))}, )
class MetricData(Type, Node): time = non_null(str) source_id = Field(non_null(str), graphql_name="sourceId") label = str data = str metadata = str
class MetricLabel(Type): source_id = non_null(str) label = non_null(str)
class CreateFacilityInput(Input): facility = Field(non_null("FacilityInput"), graphql_name="facility")
class FacilityInput(Input): name = non_null(str) slug = non_null(str) timezone_name = non_null(str)