Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose deprecatedById in workflowRuns query interface #300

Merged
merged 4 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions entities/api/schema.graphql

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

81 changes: 81 additions & 0 deletions entities/api/schema.json

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

27 changes: 9 additions & 18 deletions entities/api/types/taxon.py

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

18 changes: 18 additions & 0 deletions entities/cli/gql_schema.py

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

11 changes: 10 additions & 1 deletion platformics/client/entities_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -2911,7 +2911,7 @@ class SequencingRead(sgqlc.types.Type, EntityInterface, Node):

class Taxon(sgqlc.types.Type, EntityInterface, Node):
__schema__ = entities_schema
__field_names__ = ('id', 'wikipedia_id', 'description', 'common_name', 'name', 'is_phage', 'upstream_database', 'upstream_database_identifier', 'level', 'consensus_genomes', 'consensus_genomes_aggregate', 'sequencing_reads', 'sequencing_reads_aggregate', 'producing_run_id', 'owner_user_id', 'collection_id', 'created_at', 'updated_at', 'deleted_at')
__field_names__ = ('id', 'wikipedia_id', 'description', 'common_name', 'name', 'is_phage', 'upstream_database', 'upstream_database_identifier', 'level', 'tax_parent_id', 'tax_species_id', 'tax_genus_id', 'tax_family_id', 'tax_order_id', 'tax_class_id', 'tax_phylum_id', 'tax_kingdom_id', 'tax_superkingdom_id', 'consensus_genomes', 'consensus_genomes_aggregate', 'sequencing_reads', 'sequencing_reads_aggregate', 'producing_run_id', 'owner_user_id', 'collection_id', 'created_at', 'updated_at', 'deleted_at')
id = sgqlc.types.Field(sgqlc.types.non_null(ID), graphql_name='id')
wikipedia_id = sgqlc.types.Field(String, graphql_name='wikipediaId')
description = sgqlc.types.Field(String, graphql_name='description')
Expand All @@ -2925,6 +2925,15 @@ class Taxon(sgqlc.types.Type, EntityInterface, Node):
)
upstream_database_identifier = sgqlc.types.Field(sgqlc.types.non_null(String), graphql_name='upstreamDatabaseIdentifier')
level = sgqlc.types.Field(sgqlc.types.non_null(TaxonLevel), graphql_name='level')
tax_parent_id = sgqlc.types.Field(ID, graphql_name='taxParentId')
tax_species_id = sgqlc.types.Field(ID, graphql_name='taxSpeciesId')
tax_genus_id = sgqlc.types.Field(ID, graphql_name='taxGenusId')
tax_family_id = sgqlc.types.Field(ID, graphql_name='taxFamilyId')
tax_order_id = sgqlc.types.Field(ID, graphql_name='taxOrderId')
tax_class_id = sgqlc.types.Field(ID, graphql_name='taxClassId')
tax_phylum_id = sgqlc.types.Field(ID, graphql_name='taxPhylumId')
tax_kingdom_id = sgqlc.types.Field(ID, graphql_name='taxKingdomId')
tax_superkingdom_id = sgqlc.types.Field(ID, graphql_name='taxSuperkingdomId')
consensus_genomes = sgqlc.types.Field(sgqlc.types.non_null(ConsensusGenomeConnection), graphql_name='consensusGenomes', args=sgqlc.types.ArgDict((
('where', sgqlc.types.Arg(ConsensusGenomeWhereClause, graphql_name='where', default=None)),
('order_by', sgqlc.types.Arg(sgqlc.types.list_of(sgqlc.types.non_null(ConsensusGenomeOrderByClause)), graphql_name='orderBy', default=())),
Expand Down
4 changes: 4 additions & 0 deletions platformics/codegen/templates/api/types/class_name.py.j2
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,8 @@ class {{ cls.name }}(EntityInterface):
{%- elif attr.type == "File" %}
{{ attr.name }}_id: Optional[strawberry.ID]
{{ attr.name }}: Optional[Annotated["File", strawberry.lazy("api.files")]] = load_files_from("{{ attr.name }}") # type: ignore
{%- elif attr.type == cls.name %}
{{ attr.name }}_id: Optional[strawberry.ID]
{%- elif attr.inverse %}
{{ attr.name }}: {{ "Sequence" if attr.multivalued else "Optional" }}[Annotated["{{ attr.type }}", strawberry.lazy("api.types.{{ attr.related_class.snake_name }}")]] = load_{{ attr.related_class.snake_name }}_rows # type:ignore
{%- if attr.multivalued %}
Expand Down Expand Up @@ -580,8 +582,10 @@ async def update_{{ cls.snake_name }}(
{{field.name}} = await get_db_rows(db.{{ field.related_class.name }}, session, cerbos_client, principal, {"id": {"_eq": validated.{{field.name}}_id } }, [], CerbosAction.VIEW)
if not {{field.name}}:
raise PlatformicsException("Unauthorized: {{field.name}} does not exist")
{%- if field.type != cls.name %}
params["{{field.name}}"] = {{field.name}}[0]
del params["{{field.name}}_id"]
{%- endif %}
{%- endif %}
{%- endfor %}

Expand Down
1 change: 1 addition & 0 deletions workflows/api/schema.graphql

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

9 changes: 9 additions & 0 deletions workflows/api/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,15 @@
"ofType": null
}
},
{
"args": [],
"name": "deprecatedById",
"type": {
"kind": "SCALAR",
"name": "ID",
"ofType": null
}
},
{
"args": [],
"name": "ownerUserId",
Expand Down
3 changes: 1 addition & 2 deletions workflows/api/types/workflow_run.py

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

2 changes: 2 additions & 0 deletions workflows/cli/gql_schema.py

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

Loading