Class: Ciflows::GraphqlV2
- Inherits:
-
Object
- Object
- Ciflows::GraphqlV2
- Defined in:
- lib/ciflows/graphql_v2.rb
Constant Summary collapse
- HTTP =
GraphQL::Client::HTTP.new('https://api.circleci.com/graphql-unstable') do def headers(_context) { "User-Agent": 'My Client', 'Authorization': Ciflows::CI_TOKEN } end end
- Schema =
GraphQL::Client.load_schema(HTTP)
- Client =
GraphQL::Client.new(schema: Schema, execute: HTTP)
Instance Attribute Summary collapse
-
#approve_job ⇒ Object
Returns the value of attribute approve_job.
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#job ⇒ Object
Returns the value of attribute job.
-
#job_name ⇒ Object
readonly
Returns the value of attribute job_name.
-
#schema ⇒ Object
readonly
Returns the value of attribute schema.
-
#workflow ⇒ Object
Returns the value of attribute workflow.
-
#workflow_id ⇒ Object
readonly
Returns the value of attribute workflow_id.
Instance Method Summary collapse
- #get_workflow ⇒ Object
-
#initialize(workflow_id, job_name) ⇒ GraphqlV2
constructor
A new instance of GraphqlV2.
Constructor Details
#initialize(workflow_id, job_name) ⇒ GraphqlV2
Returns a new instance of GraphqlV2.
21 22 23 24 |
# File 'lib/ciflows/graphql_v2.rb', line 21 def initialize(workflow_id, job_name) @workflow_id = workflow_id @job_name = job_name end |
Instance Attribute Details
#approve_job ⇒ Object
Returns the value of attribute approve_job.
19 20 21 |
# File 'lib/ciflows/graphql_v2.rb', line 19 def approve_job @approve_job end |
#client ⇒ Object (readonly)
Returns the value of attribute client.
18 19 20 |
# File 'lib/ciflows/graphql_v2.rb', line 18 def client @client end |
#job ⇒ Object
Returns the value of attribute job.
19 20 21 |
# File 'lib/ciflows/graphql_v2.rb', line 19 def job @job end |
#job_name ⇒ Object (readonly)
Returns the value of attribute job_name.
18 19 20 |
# File 'lib/ciflows/graphql_v2.rb', line 18 def job_name @job_name end |
#schema ⇒ Object (readonly)
Returns the value of attribute schema.
18 19 20 |
# File 'lib/ciflows/graphql_v2.rb', line 18 def schema @schema end |
#workflow ⇒ Object
Returns the value of attribute workflow.
19 20 21 |
# File 'lib/ciflows/graphql_v2.rb', line 19 def workflow @workflow end |
#workflow_id ⇒ Object (readonly)
Returns the value of attribute workflow_id.
18 19 20 |
# File 'lib/ciflows/graphql_v2.rb', line 18 def workflow_id @workflow_id end |
Instance Method Details
#get_workflow ⇒ Object
30 31 32 |
# File 'lib/ciflows/graphql_v2.rb', line 30 def get_workflow @workflow ||= Client.query(Query::WorkflowQuery, variables: { id: workflow_id }) end |