Layer7 API Management

 View Only

 API Gateway improvement to download the graphman schema

Sylvain RICHARD's profile image
Sylvain RICHARD posted Apr 03, 2025 10:48 AM

Hi

In API Gateway 11.1.1, the ability to download the GraphQL schema from Graphman is missing. As for a WSDL, SWAGGUER, WADL.

Currently I have only found it from the community. graphman-client/schema at main · Layer7-Community/graphman-client · GitHub

But, I have no proof that this schema is the schema for my gateway.

Furthermore I imagine that the next patches can update the schema.

Introspection is not an option when your machines are in the DMZ. No introspection tools can be installed.

Pleas could you add this feature in the next release?

Sylvain

Francois Lascelles's profile image
Broadcom Employee Francois Lascelles

Hi Sylvain,

Introspection goes through the same channel as the API itself therefore if you have access to the API, you should have access to the schema via introspection regardless if you are dmz deployed.

Here's a screenshot of getting schema via introspection in 11.1.1

Can you please elaborate if that doesn't work for you or if this method is not sufficient?

Thanks for your post,

-fl

Sylvain RICHARD's profile image
Sylvain RICHARD

Hi Fancois.

I want to get this schema in one request. Then get this result https://github.com/Layer7-Community/graphman-client/tree/main/schema.

This way you can easily compare schema evolutions between versions.

Without tools, manual introspection is a pain. It requires dozens of requests.

Sylvain

Francois Lascelles's profile image
Broadcom Employee Francois Lascelles

Hi Sylvain,

I took another look at this. Pulling the entire schema with a single introspection query is possible - I found an example online which I share at the bottom. However, that results in very verbose responses and may not be practical – potentially helpful if used in conjunction with a diff command to isolate changes.

Our searching for a mechanism to return the original schema in IDL format as you request does not result in any apparent standard pattern. As previously mentioned, client-side tools are able to achieve this and I was able to successfully do it against graphman using this command:

> get-graphql-schema https://admin:7layer@localhost:8443/graphman  > current_graphman.graphql

I wish there was a standard way to achieve what you want so we don’t come up with a proprietary one. I do understand the value. If you do see other graphql APIs doing something similar, please share. Our product team has been made aware of your request for consideration in the meantime.

Example introspection query for complete schema:

query IntrospectionQuery {

  __schema {

    queryType {

      name

    }

    mutationType {

      name

    }

    subscriptionType {

      name

    }

    types {

      ...FullType

    }

    directives {

      name

      description

      locations

      args {

        ...InputValue

      }

    }

  }

}

fragment FullType on __Type {

  kind

  name

  description

  fields(includeDeprecated: true) {

    name

    description

    args {

      ...InputValue

    }

    type {

      ...TypeRef

    }

    isDeprecated

    deprecationReason

  }

  inputFields {

    ...InputValue

  }

  interfaces {

    ...TypeRef

  }

  enumValues(includeDeprecated: true) {

    name

    description

    isDeprecated

    deprecationReason

  }

  possibleTypes {

    ...TypeRef

  }

}

fragment InputValue on __InputValue {

  name

  description

  type {

    ...TypeRef

  }

  defaultValue

}

fragment TypeRef on __Type {

  kind

  name

  ofType {

    kind

    name

    ofType {

      kind

      name

      ofType {

        kind

        name

        ofType {

          kind

          name

          ofType {

            kind

            name

            ofType {

              kind

              name

              ofType {

                kind

                name

              }

            }

          }

        }

      }

    }

  }

}

Sylvain RICHARD's profile image
Sylvain RICHARD

Hi Francois.

Thank you for the introspection query request.

I see that you have understood the need well.

I would like to get the schema in SDL format. This format is easy to read. Schemas and Types | GraphQL

  • The introspection question you sent me, report 30,660 lines.
  • The schema in SDL Format is composed of 5587 lines.  So really easier to read.

SDL Format: graphman-client/schema/v11.1.1/schema.graphql at main · Layer7-Community/graphman-client · GitHub

For me, introspection can be a good solution in dev if we have tools such as (Apollo CLI, GraphQL CLI,...). Unfortunately our servers are in DMZ. So it would be simpler to retrieve the schema.graphql in SDL format with a simple query.

I hope the dev team will find a solution in future versions.

Have a good day.

Sylvain