Page MenuHomePhabricator

[dagster-graphql] predefined queries
ClosedPublic

Authored by alangenfeld on Aug 5 2019, 10:02 PM.

Details

Reviewers
schrockn
Group Reviewers
Restricted Project
Commits
R1:396eb2b2ba48: [dagster-graphql] predefined queries
Summary

Changes the dagster CLI to take one of three options to determine what graphql doc to exec:

  • -t for text
  • --file for file
  • -p for predefined query
Test Plan
(dagenv36) ~/dagster/examples:named-queries$ dagster-graphql --file tmp.txt
{"data": {"__typename": "Query"}}
(dagenv36) ~/dagster/examples:named-queries$ dagster-graphql -p startPipelineExecution
{"errors": [{"locations": [{"column": 3, "line": 2}], "message": "Variable \"$executionParams\" of required type \"ExecutionParams!\" was not provided."}]}
(dagenv36) ~/dagster/examples:named-queries$ dagster-graphql -t {__typename}
{"data": {"__typename": "Query"}}

as well as updated test cases

Diff Detail

Repository
R1 dagster
Branch
named-queries (branched from master)
Lint
Lint OK
Unit
No Unit Test Coverage

Event Timeline

alangenfeld created this revision.Aug 5 2019, 10:02 PM

Having the option to pass in the query as a graphql file (instead of a string) would be really helpful, especially for longer queries

alangenfeld planned changes to this revision.Aug 5 2019, 10:32 PM

making explicit options

alangenfeld updated this revision to Diff 3418.Aug 5 2019, 10:48 PM
(dagenv36) ~/dagster/examples:named-queries$ dagster-graphql --file tmp.txt
{"data": {"__typename": "Query"}}
(dagenv36) ~/dagster/examples:named-queries$ dagster-graphql -p startPipelineExecution
{"errors": [{"locations": [{"column": 3, "line": 2}], "message": "Variable \"$executionParams\" of required type \"ExecutionParams!\" was not provided."}]}
(dagenv36) ~/dagster/examples:named-queries$ dagster-graphql -t {__typename}
{"data": {"__typename": "Query"}}
python_modules/dagster-graphql/dagster_graphql/cli.py
131

-f conflicts with repository_target_argument -f, any ideas for better names?

alangenfeld edited the summary of this revision. (Show Details)Aug 5 2019, 11:06 PM
alangenfeld edited the test plan for this revision. (Show Details)
max added a subscriber: max.Aug 7 2019, 6:44 PM

this is so fancy and nice

alangenfeld edited the test plan for this revision. (Show Details)Aug 7 2019, 6:44 PM
This revision is now accepted and ready to land.Aug 7 2019, 6:51 PM
This revision was automatically updated to reflect the committed changes.