Unable to use dynamic fields in GraphQL query body

Hello. I want to use variables in my graphql query but it gave me error: Syntax Error: Unexpected Name, found "{".

query GetEntries {
  {{ registry }} {
    id
    name
    created_at
    updated_at
  }
}

I tried following Adding variable to GraphQL QUery - #2 by victoria but it's doesn't work and it's not what I want.
If I make it like this:

query GetEntries($registry: String) {
  registry {
    id
    name
    created_at
    updated_at
  }
}

It gave me: Cannot query field registry on type "query_root".
What I want is to pass an argument register to the query to use it as a dynamic field in the query body but I can't figure out how to do it.

Hey @songpola! Happy to help with this. Would you mind sharing a screenshot of your current query?