Using graphQL to get all metadata of a given status level

Hello Community,

I’m using graphQL to try and load all Data Elements that are of a certain endorsement level. I want to omit all the content that hasn’t been approved beyond a certain level. I plan to replicate this for Value Domains and Data Element Concepts next.

I’ve gotten what I basically want through a query like this:

The problem is that it’s not parameterised. It simply grabs everything, and it’ll be up to the receiving code to sort through it all and omit the lesser status content.

Being a newbie with graphQL, every time I try to make a parameter based on stateName it fails to work.

Is there some server side configuration needed in order to make selections based on stateName ?

I thought it might need to go here, but all that’s available is the isCurrent function and ra:
image

The only parameterised graphQL query I’ve written prior to this was one using UUID. Apologies if this is a silly question and I’ve missed something obvious. I’ll keep researching.

Warm regards,

Michael

Hey @Michael this is a great suggestion. I had @silke
You should see this functionality in Tuesday’s release.

1 Like

Actually if I can be greedy, I’d ask for it to operate pretty much on all metadata entity types. I have a feeling if this works out I’ll move to Distributions and Data Sets next.

Thanks guys for an amazing turnaround :+1:

@Michael, just sending you a message to tell you that this feature has been released today.
Thanks for suggesting it, I think it is going to be very useful.
Here’s an example query to get you started:

  query {
    dataElements (status: "candidate") {
      edges {
        node {
          name
          aristotleId
          uuid
          statuses {
            id
            stateName
          }
        }
      }
    }
  }

This will work on all concept types. Have fun!

@silke thank you, I’ll test it out now and see what fun can be had. Much appreciated :grinning:

1 Like