Skip to content

Commit

Permalink
docs(graphql): ensure descriptions for all subscription fields (#8348)
Browse files Browse the repository at this point in the history
  • Loading branch information
rexledesma committed Jun 13, 2022
1 parent 426a17a commit 2e50477
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 2 deletions.
14 changes: 14 additions & 0 deletions js_modules/dagit/packages/core/src/graphql/schema.graphql

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,16 @@


class GrapheneDagitSubscription(graphene.ObjectType):
"""The root for all subscriptions to retrieve real-time data from the Dagster instance."""

class Meta:
name = "DagitSubscription"

pipelineRunLogs = graphene.Field(
graphene.NonNull(GraphenePipelineRunLogsSubscriptionPayload),
runId=graphene.Argument(graphene.NonNull(graphene.ID)),
cursor=graphene.Argument(graphene.String),
description="Retrieve real-time event logs after applying a filter on run id and cursor.",
)

computeLogs = graphene.Field(
Expand All @@ -26,10 +29,12 @@ class Meta:
stepKey=graphene.Argument(graphene.NonNull(graphene.String)),
ioType=graphene.Argument(graphene.NonNull(GrapheneComputeIOType)),
cursor=graphene.Argument(graphene.String),
description="Retrieve real-time compute logs after applying a filter on run id, step name, log type, and cursor.",
)

locationStateChangeEvents = graphene.Field(
graphene.NonNull(GrapheneLocationStateChangeSubscription)
graphene.NonNull(GrapheneLocationStateChangeSubscription),
description="Retrieve real-time events when a location in the workspace undergoes a state change.",
)

def resolve_pipelineRunLogs(self, graphene_info, runId, cursor=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_schema_type_names_without_graphene(runner):
), f"'Graphene' cannot be included in the GraphQL type name. Violating types: {violations}."


@pytest.mark.parametrize("operation_type", ["queryType", "mutationType"])
@pytest.mark.parametrize("operation_type", ["queryType", "mutationType", "subscriptionType"])
def test_schema_operation_fields_have_descriptions(runner, operation_type):
query = f"""
query GetOperationFieldDescriptions {{
Expand Down

0 comments on commit 2e50477

Please sign in to comment.