GraphQlGetAsync giving exception "The app, schema or entity does not exist" in Squidex.ClientLibraray 14.2.0

Hi Team,

Please help me to identify and solve below issue -
GraphQlGetAsync giving exception “The app, schema or entity does not exist” in Squidex.ClientLibraray 14.2.0

stackTrace

at Squidex.ClientLibrary.Utils.SquidexClientBase.d__14.MoveNext()
at Squidex.ClientLibrary.Utils.SquidexClientBase.d__121.MoveNext() at Squidex.ClientLibrary.ContentsSharedClient2.d__2`1.MoveNext()
at BBC.Studios.Virtual.Events.Infrastructure.Booths.ScheduleClient.d__4.MoveNext() in C:\projects\Microservices\bbc-studios-virtual-events\src\Infrastructure\Booths\ScheduleClient.cs:line 56

Nuget package - Squidex.ClientLibrary 14.2.0

Complete code as below

 private readonly IContentsClient<Schedule, ScheduleData> scheduleClient;

 private readonly IContentsSharedClient<Schedule, ScheduleData> scheduleSharedClient;

 public ScheduleClient(ISquidexClientManager clientManager)
 {
    scheduleClient = clientManager.CreateContentsClient<Schedule, ScheduleData>("schedules");
    scheduleSharedClient = clientManager.CreateSharedContentsClient<Schedule, ScheduleData>("schedules");
 }

 public async Task<IEnumerable<ScheduleSessions>> GetSchedules(ScheduleSearchModel scheduleSearchModel)
    {
        try
        {
            var query = GetScheduleReferencesGraphQlQuery(scheduleSearchModel);
            var result = await scheduleSharedClient.GraphQlGetAsync<ScheduleItemResult>(query);
            return result.QueryScheduleContents?.OrderBy(x => x.Data.Date).Select(MapToSessionItemModel).ToList();
        }
        catch(Exception ex)
        {
            return null;
        }
    }

private static object GetScheduleReferencesGraphQlQuery(ScheduleSearchModel model)
    {
        var contentQuery = new ContentQuery();

        if (!string.IsNullOrWhiteSpace(model.Id))
        {
            contentQuery.Filter = $"id eq '{model.Id}'";
        }

        if (!string.IsNullOrWhiteSpace(model.EventId))
        {
            contentQuery.Filter = contentQuery.Filter == null
                ? $"data/EventId/iv eq '{model.EventId}'"
                : $"{contentQuery.Filter} and data/EventId/iv eq '{model.EventId}'";
        }

        var participantQuery = new ContentQuery
        {
            Filter = $"data/ParticipantId/iv eq '{model.ParticipantId}'"
        };

        var query = new
        {
            query = @" query ContentsQuery($filter: String!, $orderby: String!, $filterParticipant: String!) {
                querySchedulesContents(filter: $filter,orderby: $orderby) {
                        id
                        data {
                          eventId { iv} date {iv} timeZone {iv}
                          }
                        referencingBoothsContents{
                              id,
                          referencingBoothparticipantsContents(filter: $filterParticipant) {
                                id
                                data { participantId {iv} registrationDate {iv} status{iv} }
                              }
                              data{ name{iv} description{iv} start{iv} end{iv} registrationRequired{iv} allowParticipantToJoinBefore{iv} startedStatus{iv}
                               attendant {
                                  iv {
                                    email
                                  }
                                }
                            }
                          }   
                        referencingSessionsContents {
                          id
                          referencingSessionparticipantsContents(filter: $filterParticipant) {
                                id
                                data { participantId {iv}  registrationDate {iv} status{iv} }
                              }
                          data { title {iv} description {iv} start {iv} end {iv}  registrationRequired{iv} allowParticipantToJoinBefore{iv} startedStatus{iv}
                            moderator{
                                iv {
                                  email
                                }
                              }
                             schedule{
                                    iv {
                                      id
                                    }
                                  }
   speakers {
      iv {
        id
        data {
          name {
            iv
          }
          eventId {
            iv
          }
          jobTitle {
            iv
          }
          companyName {
            iv
          }
          description {
            iv
          }
thumbnail {
            iv {
              id
            }
          }
        }
      }
    }
                          }
                        }
                  }
                                 }",
            variables = new
            {
                filter = contentQuery.Filter,
                filterParticipant = participantQuery.Filter,
                orderby = "data/Date/iv desc"
            }
        };

        return query;
    }

Are you sure that you have permissions for the app. I use the client library for the API tests as well and there is very likely no bug.

Hi, sorry I have not inform that we are using on-premise application, this application deployed on our own server
https://calama.int.ourserver.com/app/events/schemas. this is altered server name.

It does not change anything. I think there is a configuration issue somehow. Perhaps the wrong client id and secret or something like that.

I think, It’s not a configuration issue or any wrong key issue. Because my below code is working so the problem is only with GraphQlGetAsync method which is coming from IConentsSharedClient<>.

Working code :
var result = await scheduleClient.GetAsync(contentQuery);

I have done a test for that: https://github.com/Squidex/squidex/blob/eb0a72808cb3d8b57693c7e05d72fbebfddf5669/tools/TestSuite/TestSuite.ApiTests/ContentQueryTests.cs#L652

Does your query work with Post?

Yes, so all methods of scheduleClient is working get, post, delete.
In earlier version of squidex.ClientLibrary, GraphQlGetAsync was part IContentsClient so it is working in that version but after upgrade to 14.2.0 it’s a part of IContentsSharedClient, so I’ve create scheduleSharedClient but now this GraphQlGetAsync getting issue.

It’s working fine with squidex.clientlibrary version 7.4.0,

As I said: It works for me. If you have a small sample to reproduce it, I can have another look.

If possible can you please provide me the code which you have written, so I can compare my code and check the issue.

I have added a link above. I have not written any new code.

let me create one poc and check again, if found same issue, i’ll inform and share code with you, thanks for your help.

I had the same issue here when upgrading from version 9 to version 11 of the Squidex.ClientLibrary. I haven’t been able to resolve it yet.

Which problem exactly?

@Sebastian
Same issue at my side. Issue comes randomly and on one page it works and doesn’t work on another page. App, Schema, Connections details are all correct. I can fetch data at 4 other places of the same function but failed for one schema which exists and name is verified.

A random issue still exists in the latest version - The app, schema or entity does not exist.

Perhaps you could write a custom http client handler and log some details. Perhaps there is no authentication header or something like this.

EDIT: Here is a sample for that: https://github.com/Squidex/squidex-samples/commit/a9c77e45aae04badab72c9b5ad85aec593096e12