đŸŒĒī¸Variables

Learn how you can add variables to an Airstack GraphQL query to provide dynamic inputs into the API.

You can add variables to an Airstack GraphQL query to provide dynamic inputs.

To do so, simply define the variable with $ prefix and specify the correct typing.

As an example, below is shown on how a query looks like after and before adding variable to an Airstack query:

query MyQuery($fid: String) { # Define the variable with its typing
  Socials(
    input: {
      filter: {
        userId: {_eq: $fid} # replace the value with the variable
      },
      blockchain: ethereum
    }
  ) {
    Social {
      profileName
    }
  }
}

Developer Support

If you have any questions or need help regarding adding variables into your Airstack query, please join our Airstack's Telegram group.

More Resources

Last updated

Was this helpful?