Giter VIP home page Giter VIP logo

Comments (3)

mrbarletta avatar mrbarletta commented on August 30, 2024

hi @ankitpatelinitio

I can't fully understand your question, but this library is made specifically to work with SuiteCRM models and you are doing a regular query (without sanitizing input by the way).

If you just need a graphql interface for your data take a look at webonyx/graphql-php.

Also, graphql needs the response definition in advance, for example in your query you have ti.id, ti.name, but you don't define what graphql types are those.

If that table is part of a SuiteCRM module, then you better use this as a guide https://github.com/lionixevolve/GraphQLSuiteCRm#extendingcustomizing-suitecrm-graphql-schema.

from graphqlsuitecrm.

ankitpatelinitio avatar ankitpatelinitio commented on August 30, 2024

@mrbarletta I would like to get data from suite CRM using graphql. So I created a custom file to write a query to get data from the relational table.

query Kanbantodoitems($kanban_ref: String) {
    Kanbantodoitems(kanban_ref: $kanban_ref) {
      id
      name
      due_date
      priority
      status
      todo_order
      description
      priority
      contact_id_c
    }
  }

It is working fine but when I am passing first_name at that time it will give me error field not found. Because first_name is relational table field. So How can I implement relation and return relational table result.

Thanks

from graphqlsuitecrm.

mrbarletta avatar mrbarletta commented on August 30, 2024

I am still finding hard to understand what do you mean by a relational table, SuiteCRM has models with relations, you have to use the model and its functions to get relationship data.

You can better understand this with the Account type, that has relationship with many other modules.

Here you can see how to get contacts related to the account:

https://github.com/lionixevolve/GraphQLSuiteCRM/blob/master/graphql/Schema/AccountType.php#L244

Also, please note that you are not defining fields in the build of your type

    {
    }

from graphqlsuitecrm.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.