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

Add additional Query error handling #195

Open
drew-russell opened this issue Feb 9, 2020 · 0 comments
Open

Add additional Query error handling #195

drew-russell opened this issue Feb 9, 2020 · 0 comments

Comments

@drew-russell
Copy link
Contributor

drew-russell commented Feb 9, 2020

Describe the solution you'd like

We should add additional error handling to the query base function.

  1. If operation_name is populated, make sure it's at the start of the query
  2. If variables are provided, make sure they are in the query
  3. Potentially automatically remove "query" from the first part of the provided query body since its not needed
import rubrik_cdm

rubrik = rubrik_cdm.Connect()

operation_name = "ClusterDetails"

query = """
ClusterDetails($clusterID: String!) {
  cluster(id: $clusterID) {
    version
  }
}
"""

variables = {
    "clusterID": "me"
}

cluster_details = rubrik.query(query, operation_name, variables)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant