Best Practice

Working with APIs via GraphQL

  • 12 January 2022
  • 5 replies
  • 417 views

Userlevel 1
Badge +1

Querying APIs via GraphQL

Did you know that your ONE solution already comes with a preconfigured GraphQL interface that can be used to run API queries in your web application?

The GraphQL Playground is available at the following URL: <web_app_URL>/playground

You can use the queries for a wide range of operations to read or manipulate data in the Ataccama application, for instance:

  • Listing your Catalog Items, associated Terms or Connection Sources
  • Checking the status of your Catalog items
  • Trigger a Profiling of a Catalog item
  • Publish an Entity from a Draft state
  • … and many more!

Example

List all available Catalog items via a query:

 

Make sure you get familiar with this powerful feature. Visit the following page and get familiar with the basics via following a series of simple use cases. Good luck!


5 replies

Userlevel 4
Badge +3

In this example, could you add how to get the attribute-GID. I would like to get the list of attributes for each catalogItem.

@Martin Danek 

 

Badge

Does anyone know if there is a special keycloak permission needed for the schema tab to be enabled.  It just hangs for me.

 

thanks in advance!

 

Greg

Badge

 

Does anyone know if there is a special keycloak permission needed for the schema tab to be enabled.  It just hangs for me.

 

thanks in advance!

 

Greg

Hey Greg!

The issue here is not a lack of permissions, but the GQL Introspection which is disabled by default.
It can be enabled by using 

ataccama.one.mmm.api.introspection.caching.enabled=true

 

 

Badge

Awesome!  Thanks Alex.  We will try that out:  I am sure it will work.  

 

Have a great day!

 

gV

Badge

In this example, could you add how to get the attribute-GID. I would like to get the list of attributes for each catalogItem.

@Martin Danek

 

Hello Marnix,

There are two queries you can use to get the attributes.

First one is to get the GID for the catalog items:

query listCatalogItems {

    catalogItems(versionSelector: {draftVersion: true}) {

        edges {

            node {

                gid

                draftVersion {

                    name

                    attributes {

                        edges {

                            node {

                                gid

                                draftVersion {

                                    name

                                }

                            }

                        }

                    }

                }

            }

        }

    }

}
The second one will be for the attributes of the catalog item by using its GID:

query listAttributes ($gid: GID!) {

    catalogItem(gid: $gid) {

        publishedVersion {

            attributes {

                edges {

                    node {

                        gid

                        draftVersion {

                            name

                        }

                    }

                }

            }

        }

    }

}
 

Reply