Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered
Hi,
While loading one sproc into Graph API, we are getting below error -
Could not fetch data for the selected type.
Our purpose is to use Microsoft GraphQL API to execute Stored procedures in Fabric SQL. While debugging issue if we remove refrence of temp table in stored procedure then its work fine but we need temp tables inside stored procedure. can you pls help.
Solved! Go to Solution.
Hi @harmirza ,
This issue usually happens when the Graph API can't properly parse or handle temp tables inside the stored procedure. Since removing the temp table makes it work, it's likely that the API doesn't support certain temp table behaviors or scopes.
One workaround you could try is using table variables instead of temp tables, if that fits your use case. Another option is to refactor the logic so that the temp table usage is minimized or moved outside the part being called by Graph API.
Also, make sure your sproc is returning a result set that the API can consume — sometimes even a small mismatch in expected output can cause this kind of error.
Hope this helps a bit!
If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
Hi @harmirza
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Hi @harmirza ,
Thanks for reaching out to the Microsoft fabric community forum.
Please check out the limitations of GraphQL while utilizing stored procedure
Limitations for Stored Procedures (Applies to Azure SQL, SQL Database in Fabric, and Data Warehouses):
- Only the first result set returned by the stored procedure is used by API for GraphQL.
- Only those stored procedures whose metadata for the first result set described by sys.dm_exec_describe_first_result_set are supported.
- When a stored procedure parameter is specified both in the configuration file and in the URL query string, the parameter in the URL query string takes precedence.
- Entities backed by a stored procedure don't have all the capabilities automatically provided for entities backed by tables or views.
- Stored procedure backed entities don't support pagination, ordering, or filtering. Nor do such entities support returning items specified by primary key values.
source: Limitations of API for GraphQL - Microsoft Fabric | Microsoft Learn
Please check if any of these points are the cause for the error you are receiving.
If you find this post helpful, please mark it as an "Accept as Solution" and consider giving a KUDOS. Feel free to reach out if you need further assistance.
Thank you
Hi @harmirza ,
This issue usually happens when the Graph API can't properly parse or handle temp tables inside the stored procedure. Since removing the temp table makes it work, it's likely that the API doesn't support certain temp table behaviors or scopes.
One workaround you could try is using table variables instead of temp tables, if that fits your use case. Another option is to refactor the logic so that the temp table usage is minimized or moved outside the part being called by Graph API.
Also, make sure your sproc is returning a result set that the API can consume — sometimes even a small mismatch in expected output can cause this kind of error.
Hope this helps a bit!
If my response resolved your query, kindly mark it as the Accepted Solution to assist others. Additionally, I would be grateful for a 'Kudos' if you found my response helpful.
Yes I change to Table variables and now stored procedure worked in Graph QL API.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Fabric update to learn about new features.
User | Count |
---|---|
56 | |
29 | |
18 | |
10 | |
4 |
User | Count |
---|---|
66 | |
54 | |
21 | |
8 | |
6 |