Guides and Examples
Nue Platform
Query Nue Objects using GraphQL
6 min
introduction nue offers a dual platform, which means nue’s platform stores and manages data from 2 different saas platforms salesforce & nue’s cloud services if your nue instance is connected to a salesforce org, all the objects that support products and pricing have salesforce as the only data source you can use nue’s graphql service to access the data of any objects in nue the object can be queried from either salesforce or from nue's aws services, depending on the data source you can login to nue and navigate to settings > business objects, and see a list of objects in nue for any object in the list, if salesforce api name is not empty, the object also has salesforce as the data source generate graphql query login to nue, and navigate to the settings, and search with keyword ‘graph’ and select the result ‘graphql generator’ the graphql generator will be automatically launched in the graphql generator, you can select a number of fields, and create filters if necessary the fields and filtering conditions will be automatically generated as part of the graphql query once you are ready, you can click ‘copy to clipboard’ for example, the following graphql query is generated to find all active, non bundle, standalone products query { product(where { and \[{configurable { eq false}}, {status { eq "active"}}]}) { autorenew ruby productcost c billingperiod billingtiming bundletemplate configurable createdbyid createddate defaultrenewalterm defaultsubscriptionterm defaultuomid description enddate freetrialtype freetrialunit id imageurl lastmodifiedbyid lastmodifieddate longdescription name pricebookid pricemodel productcategory recordtype referenceproductid showincludedproductoptions sku soldindependently startdate status } } run graphql query for objects in nue on salesforce almost all objects should be accessible by querying salesforce the below example shows how to query products curl location request post 'https //api nue io/async/graphql' \\ \ header 'apiaccesskey {{apiaccesskey}}' \\ \ header 'authorization bearer {{accesstoken}}' \\ \ header 'content type application/json' \\ \ data raw '{"query" "query {\n product(where { and \[{configurable { eq false}}, {status { eq \\"active\\"}}]}) {\n autorenew\n ruby productcost c\n billingperiod\n billingtiming\n bundletemplate\n configurable\n createdbyid\n createddate\n defaultrenewalterm\n defaultsubscriptionterm\n defaultuomid\n description\n enddate\n freetrialtype\n freetrialunit\n id\n imageurl\n lastmodifiedbyid\n lastmodifieddate\n longdescription\n name\n pricebookid\n pricemodel\n productcategory\n recordtype\n referenceproductid\n showincludedproductoptions\n sku\n soldindependently\n startdate\n status\n }\n}\n","variables" {}}' run graphql query for objects in nue on aws with the exception of opportunities, quotes, products, price tags, price book entires, and price books, all other objects can be queried from nue on aws, which offers significantly improved performance and speeds the below example shows how to query subscriptions curl location request post 'https //api nue io/async/graphql' \\ \ header 'apiaccesskey {{apiaccesskey}}' \\ \ header 'authorization bearer {{accesstoken}}' \\ \ header 'content type application/json' \\ \ data raw '{"query" "query subscription {\n subscription {\n actualsubscriptionterm\n autorenew\n billcycleday\n billcyclestartmonth\n billingaccountid\n billingperiod\n billingtiming\n bundled\n cancellationdate\n createdbyid\n createddate\n customerid\n defaultpaymentmethodid\n description\n entityid\n evergreen\n externalid\n externalname\n firstfullcreditperiodstartdate\n freetrialconversiondate\n id\n includedunits\n lastmodifiedbyid\n lastmodifieddate\n lastversionedsubscriptionid\n listprice\n name\n orderondate\n orderproductid\n originalsubscriptionid\n originalsubscriptionnumber\n parentid\n parentobjecttype\n pricebookentryid\n pricebookid\n productid\n quantity\n reconfigureeffectivedate\n renewalterm\n rootid\n salesprice\n status\n subscriptioncompositeid\n subscriptionenddate\n subscriptionlevel\n subscriptionstartdate\n subscriptionterm\n subscriptionversion\n taxamount\n tcv\n todayarr\n todaycmrr\n todaysquantity\n totalacv\n totalamount\n totalprice\n totaltcv\n uomid\n }\n}"}'