A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more
Hi,
I'm new to Shopify and I'm working on the GraphQL APIs. I'm looking for a way to get all Companies info for Approved Companies. Or more specifically, where a customer is approved for ordering. Or at least looking for a way to distinguish their status. I haven't been able to understand where to see this through the Graph APIs.
Any pointers would be greatly appreciated.
Thanks you
Hi @mariounkel,
The Company object in GraphQL doesn't have an "Approved" field, but our guide on creating companies mentions that "A companyContact must be added to create orders and draft orders."
The companies query can be used to retrieve a list of your store's companies, and their contactRoles connection could also be used to determine their eligibility for making orders.
Hope that helps!
- James
Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Hi,
Thanks for your answer. Yes I found the link. This gave me the info I was looking for. And with this I will filter out the companies that have a least 1 role assignment.
query MyQuery {
companies(first: 10) {
edges {
node {
id
name
externalId
locations(first: 1) {
edges {
node {
name
roleAssignments(first: 10) {
edges {
node {
role {
name
}
}
}
}
}
}
}
contacts(first: 10, query: "isMainContact:true") {
edges {
node {
isMainContact
id
customer {
email
multipassIdentifier
}
}
}
}
}
}
}
}