Edit

Share via


Fabric API for GraphQL schema view and schema explorer

The GraphQL schema, based on the GraphQL Schema Definition Language (SDL), defines the format of the data exposed in the API. It provides flexibility to consumers while hiding backend implementation details. The schema uses a collection of object types that contain fields.

Schema view

Access the schema view by selecting Schema in the lower left corner of the Data Development screen. This view shows a text-based version of the GraphQL SDL with generated types, fields, and operations.

The following image shows an example of the schema view, including a list of objects available in this schema.

Note

The schema view is read-only. Modify objects only in the Schema explorer.

Screenshot of the API schema view screen, which includes the Schema explorer in the left pane.

Schema explorer

The Schema explorer is located in the pane on the left and is also available when you use the editor in the query view. The explorer allows users to quickly visualize the available types and fields, as well as queries and mutations, defined in the API.

All the GraphQL types available from the objects you choose when you connect to a data source appear in the Schema explorer list. The types appear under the name of the data source from which they were derived. The following image shows the SalesOrderDetail type derived from the SalesOrderDetail table in the AdventureWorks SQL analytics endpoint.

Screenshot of the Schema explorer pane, showing the expanded list of types available under an example data source named SalesOrderDetail.

In addition to types, the Fabric API for GraphQL automatically generates queries and mutations for new objects you choose to expose.

In our AdventureWorks example, expanding the list of queries shows the automatically generated queries for the data source.

Screenshot of the Schema explorer pane, showing an expanded list of automatically generated queries.

Expand the mutations node in the Schema explorer tree to see the mutations automatically generated by the API.

Screenshot of the Schema explorer pane, showing an expanded list of automatically generated mutations.

Modify objects using the schema explorer

You can use the Schema explorer to modify objects after the API creates them for you. In the following example, we select the ellipsis next to the SalesOrderDetail type derived from our AdventureWorks database:

Screenshot of the schema explorer with the ellipsis selected, showing the available menu options.

The following options are available for Types:

  • Update schema - Lets you update the schema with new objects from the data source.

  • Rename - Changes the name of the object. This change only affects the API schema and doesn't affect the original data source object from which it's derived.

  • Remove from schema - Deletes the object from the GraphQL schema, so you can't reference it anymore.

  • Manage relationships - Opens the relationship management experience. For more information, see Manage relationships in Fabric API for GraphQL.

  • Properties - Shows additional information about the object.

Enable and disable queries and mutations

The enable or disable feature for queries and mutations provides administrators and developers with granular control over API access and usage. It allows you to selectively activate or deactivate specific queries and mutations within the GraphQL schema. This lets you manage API capabilities dynamically without modifying code or deploying changes.

Queries and mutations in the schema explorer have two other options:

  • Disable: Prevents any requests from running the query or mutation. If execution is attempted, an error is returned. After a query or mutation is disabled, a schema reload occurs, and the query or mutation appears grayed out in the schema explorer.

Screenshot of disable query or mutation option shown on schema explorer.

  • Enable: Lets you re-enable a previously disabled query or mutation. The query or mutation is immediately available after the schema reload operation that occurs when you select the Enable option.

Screenshot of enable query of mutation option shown on schema explorer.

Queries or mutations autogenerated from stored procedures can only be deleted. After deletion, they can be readded using the Get Data or Update Schema options.