GraphQL API for Odoo

by
Odoo

46.00

v 17.0 Third Party 4
Live Preview
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies Discuss (mail)
Community Apps Dependencies
Lines of code 2328
Technical Name easy_graphql
LicenseOPL-1
Websitehttps://ekika.co
Versions 17.0 15.0 16.0
You bought this module and need support? Click here!
Availability
Odoo Online
Odoo.sh
On Premise
Odoo Apps Dependencies Discuss (mail)
Community Apps Dependencies
Lines of code 2328
Technical Name easy_graphql
LicenseOPL-1
Websitehttps://ekika.co
Versions 17.0 15.0 16.0
Background Image

Introduction

GraphQL is an open-source data query language for APIs and a runtime for executing those queries by using a type system you define for your data. It allows clients to request exactly the data they need. This query is a set of parameters used in a GraphQL API request. These parameters define how the API should respond and what data should be included.

Two key features of GraphQL:

  • Declarative Data Fetching: GraphQL allows clients to request only the data they need and nothing more. Clients can specify the shape and structure of the response, reducing the over-fetching and under-fetching of data that often occurs in REST APIs.
  • Hierarchical Structure: GraphQL queries have a hierarchical structure, mirroring the shape of the response data. Clients can request nested fields, and the server responds with a JSON object that matches the requested structure.

How It Works:

In GraphQL, queries and mutations are two types of operations used to interact with the API:

  • Query Operation: A query in GraphQL is used to read or fetch data from the server. Clients can specify exactly what data they need, and the server will return only the requested data, no more and no less. Queries are similar to GET requests in REST APIs.
  • Mutation Operation: A mutation in GraphQL is used to modify data on the server. Mutations are similar to POST, PUT, PATCH, or DELETE requests in REST APIs. Mutations can be used for creating, updating, or deleting records.

You'll see this both operations in detail below.

Query Operations:

RoundMultiple Records

Ekika GraphQL API Read Multiple Record Image
query MyQuery($offset: Int, $limit: Int, $order: String, $domain: [[Any]]) {
   ResPartner(
      offset: $offset
      limit: $limit
      order: $order
      domain: $domain
   )
   {
      id
      name
      phone
      email
      is_company
      country_id{
         name
         code
      }
      user_id{
         name
         active
      }
      company_id{
         name
      }
   }
}

GRAPHQL Variables for above query
   {
      "offset": 0,
      "limit": 5,
      "order": "name,id desc",
      "domain": [["is_company","=",true]]
   }
    

RoundSingle Record

Ekika GraphQL API Read Single Record Image
query MyQuery {
  ResPartner(id: "33")
  {
    id
    name
    phone
    email
    is_company
    country_id{
      name
      code
    }
    user_id{
      name
      active
    }
    company_id{
      name
    }
  }
}
    

Mutation Operations:

RoundCreate Operation

Ekika GraphQL API Create Record Image
mutation Create {
    createResPartner: ResPartner(
        ResPartnerValues: {
            active: true,
            name: "Ekika Corporation New",
            category_id: [4, 3]
            company_type: "company",
            bank_ids: [
               [0, 0, {
                    sequence: 10,
                    bank_id: 2,
                    acc_number: "11212121212",
                    allow_out_payment: true,
                    acc_holder_name: false
                }],
                [0, 0, {
                    sequence: 11,
                    bank_id: 3,
                    acc_number: "3434343434343434",
                    allow_out_payment: true,
                    acc_holder_name: false
                }]
            ]
            city: "Gandhinagar",
            street: "Gandhinagar",
            street2: "",
            zip: "382421",
            comment: "<p>Comment Here</p>",
            phone: "5554444555444",
            mobile: "1010101",
            website: "http://www.ekika.co",
            email: "hello@ekika.co",
        }
    )
    {
        active
        category_id{
          id
        }
        bank_ids{
          id
          display_name
        }
        city
        comment
        company_type
        id
        name
        phone
        mobile
        email
        street
        zip
    }
}
    

RoundUpdate Operation

Ekika GraphQL API Update Record Image
mutation Update {
    updateResPartner: ResPartner(
        id: 49, 
        ResPartnerValues: {
            active: true,
            name: "Ekika Corporation PVT LTD.",
            category_id: null
            company_type: "company",
            bank_ids: [
                [1, 2, {
                    sequence: 25,
                    bank_id: 2,
                    allow_out_payment: true,
                    acc_holder_name: false
                }],
                [3, 3, 0]
            ]
        }
    )
    {
        active
        category_id{
          id
        }
        bank_ids{
          id
          display_name
        }
        city
        comment
        company_type
        id
        name
        phone
        mobile
        email
        street
        zip
    }
}
    

RoundDelete Operation

Ekika GraphQL API Delete Record Image
mutation Delete {
    deleteResPartner: ResPartner(
        id: 49, 
    ){
    id
  }
}
    

RoundMethod Operation

Ekika GraphQL API Method Operation Image
mutation Method {
    methodSaleOrder: SaleOrder(
        id: 16, 
        method_name: "action_draft",
        method_parameters: {}
    ){
    id
  }
}
    

Configuring GraphQL Setting:

Ekika GraphQL API Configuring GraphQL Setting Image

Services EKIKA Provides

EKIKA is your destination for expert Odoo ERP implementation and customization. We pride ourselves on building reliable, trust-based partnerships that give you full transparency and control over your business processes.

With over 12 years of experience, we can assist you with eCommerce platforms, production planning, point-of-sale systems, managing inventory adjustments, and providing advanced field worker tracking solutions to optimize your workflows and boost operational efficiency.

Ekika Odoo Implementation

Implementation

Utilise Odoo ERP tailored for your business needs for smooth operations.

Ekika Odoo Customization

Customization

Personalized adjustments to Odoo modules for seamless management.

Ekika Odoo Support

Support

Ongoing assistance and maintenance to optimize your Odoo system's performance.

Are you struggling with disorganized operations, high operational costs, or lack of transparency in your processes? What sets us apart is our commitment to personalized solutions tailored to your unique business needs and our proactive support, ensuring seamless integration and ongoing success.

Would you like to explore Odoo ERP for your business? Schedule a free consultation with EKIKA today!

Odoo Proprietary License v1.0

This software and associated files (the "Software") may only be used (executed,
modified, executed after modifications) if you have purchased a valid license
from the authors, typically via Odoo Apps, or if you have received a written
agreement from the authors of the Software (see the COPYRIGHT file).

You may develop Odoo modules that use the Software as a library (typically
by depending on it, importing it and using its resources), but without copying
any source code or material from the Software. You may distribute those
modules under the license of your choice, provided that this license is
compatible with the terms of the Odoo Proprietary License (For example:
LGPL, MIT, or proprietary licenses similar to this one).

It is forbidden to publish, distribute, sublicense, or sell copies of the Software
or modified copies of the Software.

The above copyright notice and this permission notice must be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

Please log in to comment on this module

  • The author can leave a single reply to each comment.
  • This section is meant to ask simple questions or leave a rating. Every report of a problem experienced while using the module should be addressed to the author directly (refer to the following point).
  • If you want to start a discussion with the author or have a question related to your purchase, please use the support page.