GRAPHQL Queries

Constructing GraphQL query client configurations and mutation payloads in Python.

Lord1Egypt Updated 2 repo stars

File contents

Graphql Queries

Overview

GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data.

When to Use This Skill

Use to interface with APIs that expose GraphQL endpoints (e.g., GitHub GraphQL API v4).

Quick Start (with runnable code examples)

import requests

url = 'https://api.github.com/graphql'
headers = {'Authorization': 'token ghp_...'}

query = """
query {
  viewer {
    login
    bio
  }
}
"""

r = requests.post(url, json={'query': query}, headers=headers)
print(r.json())

Advanced Usage

Handle GraphQL input variables, define fragment structures, configure mutations, and parse paginated cursor queries.

Key References

Dependencies

  • requests>=2.28.0

Lord1Egypt/ai-skillforge/tree/main/skills/gemini/graphql-queries commit f14268e2c7

Frequently asked questions

npx skillmds@latest add lord1egypt/graphql-queries