# Custom queries

# Introduction

Following the Extending GraphQL Queries (opens new window) ,we can override the base queries from odoo to our custom queries.

# Import the customQueries file to middleware

// middleware.config.js
const customQueries = require('./custom-project-api/customQueries');

module.exports = {
  integrations: {
    odoo: {
      location: '@vue-storefront/odoo-api/server',
      configuration: {
        odooBaseUrl,
        graphqlBaseUrl
      },
      customQueries
    }
  }
};

# Custom queries file must follow

// custom-project-api/customQueries.js

module.exports = {
  customGetProduct: ({variables}) => ({
    varialbes,
    query: gql`
      query { 
        product {
          id
          name
        } 
      }
    `,
    variables
  }),

# Reload application and pass the custom query on the composable search method