Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
The Fabric API for GraphQL provides two mechanisms to retrieve information about your schema.
Introspection: It's part of the GraphQL standard and enables programmatic querying of the schema. Introspection queries allow you to learn about a GraphQL API’s schema, and they also help power GraphQL development tools.
Schema export: It allows you to obtain an SDL (GraphQL Schema Definition Language) file that contains your complete schema for external use.
Introspection
By default, introspection is disabled on your API for GraphQL items. This setting can only be toggled by Workspace Admins. All other users will see a disabled slider. To enable it, click on the API Settings gear icon in the top menu and choose Introspection from the available settings. You'll see a toggle to enable or disable introspection:
If you enable introspection, the following confirmation dialog is displayed:
Select confirm to enable introspection or cancel to leave it disabled.
Introspection query example
Here's a quick example of an introspection query to retrieve available types from the schema:
query {
__schema {
types{
name
}
}
}
The information retrieved by introspection queries is verbose. You can use query filters to narrow the scope of the query.
To learn more about introspection, see the GraphQL Foundation's official documentation on introspection.
Export schema
Another way to retrieve schema information is using the GraphQL schema export. It works directly from the Fabric portal. Open your API for GraphQL and select Export schema. And your browser will download an SDL (Schema Definition Language) file with full schema. You can then use this SDL file in any development tool or service such as, for example, integrating with Azure API Management.