Skip to main content

GraphQL introspection and path enumeration.

Project description

graphenum PyPI CI CD

Introspect a GraphQL endpoint and generate his specification schema with path enumeration.

PyPI - Python Version PyPI - Downloads

Getting Started

It takes only two simple steps to introspect an endpoint using graphenum.

pip install graphenum
graphenum -u https://example.com/graphql -o schema.json

Options

GraphEnum supports the following options:

graphenum \
# url of the GraphQL endpoint
-u/--url https://example.com/graphql \
# input schema file (raw GraphQL schema)
-s/--schema-path schema.json \
# output file name
-o/--output-schema schema.json \
# verbose output
-v/--verbose

Environment Variables

Logger - No effect if you pass your own logger

Name Values Default Behavior
LOG_FORMAT console, json console Change the log format accordingly
DEBUG True, False False Enable debug logging

Integration

import logging

from typing import Callable, Dict, Optional, List, Tuple
from graphenum import IntrospectionSchema
from graphenum.entities.internal import Callbacks

async def async_introspect( / def introspect(
    url: str,
    logger: Optional[logging.Logger] = None,
    headers: Optional[Dict[str, str]] = None,
    verbose_mode: bool = False,
    schema_path: Optional[str] = None,
    callbacks: Optional[Dict[Callbacks, List[Callable]]] = None,
    json_encode: bool = False
) -> Tuple[IntrospectionSchema, aiohttp.ClientResponse]:
    ...

Local installation

git clone git@github.com:Escape-Technologies/graphenum.git
cd graphenum
chmod +x ./install-dev.sh
./install-dev.sh

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License PyPI - License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

graphenum-0.0.3.tar.gz (12.9 kB view hashes)

Uploaded Source

Built Distribution

graphenum-0.0.3-py3-none-any.whl (17.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page