GraphQL schema update

Platform: Realm Cloud
Clients: .Net client library, GraphQL

I’m using .Net nuget package on Win10 platform and GraphQL to access the same DB on a web app.
After I add a new field in a RealmObject class and run, the field will be added to DB automatically.
But the GraphQL interface seems cached and return the error Message: Cannot query field “<>” on type “<>”

I’ve tried to set a new FullSyncConfiguration.SchemaVersion in .NET but it still doesn’t work.
How do I update the schema on GraphQL side? Thanks

@Sing_Leung The schema is cached - you’ll need to hit this endpoint to refresh the cache after making schema changes - https://docs.realm.io/sync/graphql-web-access/using-the-graphql-client#schema-appears-to-be-cached-to-an-old-version

2 Likes

@Ian_Ward is this still the recommended approach? Those docs are not the latest version, I don’t understand how to make the call as your link suggests and I can’t find anything about this for the current latest version of realm.

How to use the API - Realm Sync (LEGACY) says

Use DELETE /graphql/schema/:path to clear the cached schema of the Realm atpath if schema caching is enabled (e.g. due to a recent schema change).

Is there a code example of this?

It would be great if realm could clear the graphql cache automatically when the schema is modified…

1 Like