Unable to push graphql custom resolvers with same field_name by realm-cli

I have 2 custom resolvers which resolve owner user data for different parent types
it’s defined like this (the on_type is different for another parent type)

{
    "field_name": "ownerData",
    "function_name": "resolveOwnerData",
    "input_type_format": "",
    "on_type": "Template",
    "payload_type": "User",
    "payload_type_format": "generated"
}

when I run realm-cli, it shows error

push failed: must specify unique names when importing CustomResolvers; duplicate name: ownerData

if I change one field_name to another different string, it can be pushed normally

Moreover, I tried to create a custom resolver in realm web UI, it can be created normally, both resolvers have the same field name

And then I export the app from the web UI, unzip it and try to push it again, it shows the same error as above

1 Like

Hi Matt,

It looks like this is an existing bug on the Realm CLI. We’ve recently released the App Services CLI (atlas-app-services-cli - npm) and I’ve tested this case and it should work. If your app is of the latest config version using the Realm CLI (ie you have a realm_config.json file) then you should be able to use the App Services CLI out of the box without modifying your pulled app at all–we recommend you upgrade since we’ll no longer be maintaining the Realm CLI.

Let me know if you run into any other issues!