{
"info": {
"author": "ACSONE SA/NV,Odoo Community Association (OCA)",
"author_email": "support@odoo-community.org",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 4 - Beta",
"Framework :: Odoo",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Programming Language :: Python"
],
"description": "============\nGraphql Base\n============\n\n.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n !! This file is generated by oca-gen-addon-readme !!\n !! changes will be overwritten. !!\n !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n\n.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png\n :target: https://odoo-community.org/page/development-status\n :alt: Beta\n.. |badge2| image:: https://img.shields.io/badge/licence-LGPL--3-blue.png\n :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html\n :alt: License: LGPL-3\n.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Frest--framework-lightgray.png?logo=github\n :target: https://github.com/OCA/rest-framework/tree/13.0/graphql_base\n :alt: OCA/rest-framework\n.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png\n :target: https://translation.odoo-community.org/projects/rest-framework-13-0/rest-framework-13-0-graphql_base\n :alt: Translate me on Weblate\n.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png\n :target: https://runbot.odoo-community.org/runbot/271/13.0\n :alt: Try me on Runbot\n\n|badge1| |badge2| |badge3| |badge4| |badge5| \n\nThis modules enables the creation of `GraphQL `__ endpoints.\nIn itself, it does nothing and must be used by a developer to\ncreate the GraphQL schema and resolvers using\n`graphene `__,\nand expose them through a controller.\nAn example is available in the ``graphql_demo`` module.\n\n**Table of contents**\n\n.. contents::\n :local:\n\nUsage\n=====\n\nTo use this module, you need to\n\n- create your graphene schema\n- create your controller to expose your GraphQL endpoint,\n and optionally a GraphiQL IDE.\n\nThis module does not attempt to expose the whole Odoo object model.\nThis could be the purpose of another module based on this one.\nWe believe however that it is preferable to expose a specific well tested\nendpoint for each customer, so as to reduce coupling by knowing precisely\nwhat is exposed and needs to be tested when upgrading Odoo.\n\nTo start working with this module, we recommend the following approach:\n\n- Learn `GraphQL basics `__\n- Learn `graphene `__, the python library\n used to create GraphQL schemas and resolvers.\n- Examine the ``graphql_demo`` module in this repo, copy it,\n adapt the controller to suit your needs (routes, authentication methods).\n- Start building your own schema and resolver.\n\nBuilding your schema\n~~~~~~~~~~~~~~~~~~~~\n\nThe schema can be built using native graphene types.\nAn ``odoo.addons.graphql_base.types.OdooObjectType``\nis provided as a convenience. It is a graphene ``ObjectType`` with a\ndefault attribute resolver which:\n\n- converts False to None (except for Boolean types), to avoid Odoo's weird\n ``False`` strings being rendered as json ``\"false\"``;\n- adds the user timezone to Datetime fields;\n- raises an error if an attribute is absent to avoid field name typing errors.\n\nCreating GraphQL controllers\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe module provides an ``odoo.addons.graphql_base.GraphQLControllerMixin``\nclass to help you build GraphQL controllers providing GraphiQL and/or GraphQL\nendpoints.\n\n.. code-block:: python\n\n from odoo import http\n from odoo.addons.graphql_base import GraphQLControllerMixin\n\n from ..schema import schema\n\n\n class GraphQLController(http.Controller, GraphQLControllerMixin):\n\n # The GraphiQL route, providing an IDE for developers\n @http.route(\"/graphiql/demo\", auth=\"user\")\n def graphiql(self, **kwargs):\n return self._handle_graphiql_request(schema)\n\n # Optional monkey patch, needed to accept application/json GraphQL\n # requests. If you only need to accept GET requests or POST\n # with application/x-www-form-urlencoded content,\n # this is not necessary.\n GraphQLControllerMixin.patch_for_json(\"^/graphql/demo/?$\")\n\n # The graphql route, for applications.\n # Note csrf=False: you may want to apply extra security\n # (such as origin restrictions) to this route.\n @http.route(\"/graphql/demo\", auth=\"user\", csrf=False)\n def graphql(self, **kwargs):\n return self._handle_graphql_request(schema)\n\nBug Tracker\n===========\n\nBugs are tracked on `GitHub Issues `_.\nIn case of trouble, please check there if your issue has already been reported.\nIf you spotted it first, help us smashing it by providing a detailed and welcomed\n`feedback `_.\n\nDo not contact contributors directly about support or help with technical issues.\n\nCredits\n=======\n\nAuthors\n~~~~~~~\n\n* ACSONE SA/NV\n\nMaintainers\n~~~~~~~~~~~\n\nThis module is maintained by the OCA.\n\n.. image:: https://odoo-community.org/logo.png\n :alt: Odoo Community Association\n :target: https://odoo-community.org\n\nOCA, or the Odoo Community Association, is a nonprofit organization whose\nmission is to support the collaborative development of Odoo features and\npromote its widespread use.\n\n.. |maintainer-sbidoul| image:: https://github.com/sbidoul.png?size=40px\n :target: https://github.com/sbidoul\n :alt: sbidoul\n\nCurrent `maintainer `__:\n\n|maintainer-sbidoul| \n\nThis module is part of the `OCA/rest-framework `_ project on GitHub.\n\nYou are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.\n\n\n",
"description_content_type": "",
"docs_url": null,
"download_url": "",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "https://github.com/OCA/rest-framework",
"keywords": "",
"license": "LGPL-3",
"maintainer": "",
"maintainer_email": "",
"name": "odoo13-addon-graphql-base",
"package_url": "https://pypi.org/project/odoo13-addon-graphql-base/",
"platform": "",
"project_url": "https://pypi.org/project/odoo13-addon-graphql-base/",
"project_urls": {
"Homepage": "https://github.com/OCA/rest-framework"
},
"release_url": "https://pypi.org/project/odoo13-addon-graphql-base/13.0.1.0.1.dev1/",
"requires_dist": [
"graphene",
"graphql-server-core",
"odoo (<13.1dev,>=13.0a)"
],
"requires_python": ">=3.5",
"summary": "Base GraphQL/GraphiQL controller",
"version": "13.0.1.0.1.dev1"
},
"last_serial": 6001949,
"releases": {
"13.0.1.0.1.dev1": [
{
"comment_text": "",
"digests": {
"md5": "86eff104342685b38ca429832af41c1b",
"sha256": "6fadb7a44aebac3ec9db5c00f7d174a9e3736c7c333a352128beb73274234d21"
},
"downloads": -1,
"filename": "odoo13_addon_graphql_base-13.0.1.0.1.dev1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "86eff104342685b38ca429832af41c1b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.5",
"size": 29348,
"upload_time": "2019-10-20T05:02:21",
"url": "https://files.pythonhosted.org/packages/d6/94/ba7d9088186356399d92393208058956b9d542ac194789769a3a1cb7442f/odoo13_addon_graphql_base-13.0.1.0.1.dev1-py3-none-any.whl"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "86eff104342685b38ca429832af41c1b",
"sha256": "6fadb7a44aebac3ec9db5c00f7d174a9e3736c7c333a352128beb73274234d21"
},
"downloads": -1,
"filename": "odoo13_addon_graphql_base-13.0.1.0.1.dev1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "86eff104342685b38ca429832af41c1b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.5",
"size": 29348,
"upload_time": "2019-10-20T05:02:21",
"url": "https://files.pythonhosted.org/packages/d6/94/ba7d9088186356399d92393208058956b9d542ac194789769a3a1cb7442f/odoo13_addon_graphql_base-13.0.1.0.1.dev1-py3-none-any.whl"
}
]
}