filiphric / cypress-plugin-api

Cypress plugin to show your API information in the Cypress UI runner
ISC License
264 stars 35 forks source link

Add ability for format GraphQL queries and mutations to preserve line breaks and indentation for better readability. #126

Open jpazBuild opened 1 year ago

jpazBuild commented 1 year ago

Evidence: image

test in cypress 12.17.2

describe('template spec', () => {
  it('passes', () => {
    cy.visit('https://example.cypress.io')
    cy.api({
      method:'POST',
      url:'https://beta.pokeapi.co/graphql/v1beta',
      body:{
        query:`query MyQuery {
          pokemon_v2_ability(distinct_on: generation_id) {
            id
          }
        }`
      }

    }

    )
  })
})

dependencies

  "devDependencies": {
    "cypress": "^12.17.2"
  },
  "dependencies": {
    "cypress-plugin-api": "^2.11.1"
  }
filiphric commented 4 months ago

I’m not sure I will be adding graphql ability anytime soon. it would require a whole lot of other work and probably a rewrite of most of how this plugin works. I’ll think about this, but for transparency I’d like to state this.