id: graphql-strawberry-detect
info:
  name: Graphql Strawberry Detect
  author: princechaddha
  severity: info
  reference:
    - https://github.com/dolevf/graphw00f/blob/main/graphw00f/lib.py
  tags: tech,graphql,strawberry

http:
  - method: POST
    path:
      - "{{BaseURL}}/graphql"
      - "{{BaseURL}}/api/graphql"
      - "{{BaseURL}}/query"
      - "{{BaseURL}}/"
    body: '{"query":"query @deprecated { __typename }"}'
    headers:
      Content-Type: application/json
    redirects: true

    matchers-condition: and
    matchers:
      - type: status
        status:
          - 200
          - 400

      - type: word
        words:
          - "Directive '@deprecated' may not be used on query."
        part: body
# digest: 490a004630440220406d1178b55874403766fff75a62bbdb90351c87a173778ee6ddf15d548bb2d602201ad82b478cf9d37141aa0d21767f484bc384edaf8e83a01732a9adc533fbd01c:922c64590222798bb761d5b6d8e72950