{"id":23814,"library":"graphene-stubs","title":"graphene-stubs","description":"graphene-stubs provides type stubs and a mypy plugin for Graphene (the GraphQL framework for Python). Version 0.16 adds comprehensive stubs for graphene objects and enhances mypy integration. Releases are infrequent.","status":"active","version":"0.16","language":"python","source_language":"en","source_url":"https://github.com/trialspark/graphene-stubs","tags":["graphene","type-stubs","mypy","graphql","type-hints"],"install":[{"cmd":"pip install graphene-stubs","lang":"bash","label":"Latest release"}],"dependencies":[{"reason":"graphene-stubs is a type stub package for graphene","package":"graphene","optional":false},{"reason":"mypy plugin requires mypy installed","package":"mypy","optional":true}],"imports":[{"note":"Incorrect plugin path in mypy config","wrong":"plugins = graphene_stubs.plugin","symbol":"mypy plugin","correct":"plugins = graphene_stubs.mypy_plugin"},{"note":"Stubs are used automatically by mypy; direct import is not needed","wrong":"import graphene_stubs","symbol":"Type stubs","correct":"from graphene_stubs import ..."}],"quickstart":{"code":"# In mypy configuration file (e.g., mypy.ini):\n[mypy]\nplugins = graphene_stubs.mypy_plugin\n\n# Example graphene code the stubs will type-check:\nimport graphene\n\nclass Query(graphene.ObjectType):\n    hello = graphene.String()\n\n    def resolve_hello(self, info):\n        return \"world\"\n\nschema = graphene.Schema(query=Query)","lang":"python","description":"Enable the mypy plugin and write a simple graphene schema. The stubs provide type inference for ObjectType, Field, etc."},"warnings":[{"fix":"Add 'plugins = graphene_stubs.mypy_plugin' to your mypy configuration file.","message":"The mypy plugin must be enabled explicitly via mypy config; it is not activated by installing the package.","severity":"gotcha","affected_versions":"all"},{"fix":"Install graphene alongside graphene-stubs: pip install graphene graphene-stubs","message":"Type stubs are not automatically installed for graphene itself. Ensure graphene is installed as a dependency.","severity":"gotcha","affected_versions":"all"},{"fix":"Monitor the repository for updates; if stubs become outdated, temporarily use # type: ignore or custom stubs.","message":"The package may not see frequent updates; consider using graphene built-in types or other stubs if support lags behind graphene releases.","severity":"deprecated","affected_versions":"<=0.16"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Install graphene-stubs and add 'plugins = graphene_stubs.mypy_plugin' to mypy.ini.","cause":"graphene-stubs not installed or mypy plugin not configured.","error":"error: Library 'graphene' has no stubs or type hints"},{"fix":"Install graphene-stubs. If already installed, check mypy configuration for plugin path.","cause":"graphene itself has no type stubs; graphene-stubs is required.","error":"mypy: Cannot find implementation or library stub for module 'graphene'"},{"fix":"Run: pip install graphene-stubs","cause":"graphene-stubs package not installed.","error":"ModuleNotFoundError: No module named 'graphene_stubs'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}