Use Realm GraphQL Client with a global/shared realm in Realm Cloud












2















I can successfully use the Realm GraphQL Client with a realm path like myInstance.us1.cloud.realm.io/~/realmName but when trying to use a global path, i.e., myinstance.us1.cloud.realm.io/realmName, I always get a 502 response from the server.



Any thoughts?



TLDR;



I have been fighting with getting data from a global/shared realm, i.e., no /~/ in the realm path with no luck. I always get a 502 Bad Gateway in response to executing a query. If I add the /~/ to the realm path, a connection is established and a new and empty user-specific realm is created (as expected) but then queries fail because the realm is empty (also expected).



Does the GraphQL Service provided by Realm Cloud support connecting to global/shared realms? I’ve skimmed over the source for both the server and client and did not see any specific reason why global/shared would not be supported.



I also tried passing isQueryBasedSync to the GraphQLConfig which results in a connection and successfully executed query, but the query responses are always empty



Any advice is greatly appreciated.










share|improve this question























  • Do you have any updates on this? I also get empty responses...

    – rouge
    Dec 13 '18 at 12:40











  • @rouge Added an answer documenting what I've done so far.

    – sellmeadog
    Dec 13 '18 at 20:21











  • thanks, I just saw your post after I posted one by myself to the realm-forum: looks like I have the same problem: forum.realm.io/t/empty-result-for-query-with-graphql/2258

    – rouge
    Dec 14 '18 at 22:17


















2















I can successfully use the Realm GraphQL Client with a realm path like myInstance.us1.cloud.realm.io/~/realmName but when trying to use a global path, i.e., myinstance.us1.cloud.realm.io/realmName, I always get a 502 response from the server.



Any thoughts?



TLDR;



I have been fighting with getting data from a global/shared realm, i.e., no /~/ in the realm path with no luck. I always get a 502 Bad Gateway in response to executing a query. If I add the /~/ to the realm path, a connection is established and a new and empty user-specific realm is created (as expected) but then queries fail because the realm is empty (also expected).



Does the GraphQL Service provided by Realm Cloud support connecting to global/shared realms? I’ve skimmed over the source for both the server and client and did not see any specific reason why global/shared would not be supported.



I also tried passing isQueryBasedSync to the GraphQLConfig which results in a connection and successfully executed query, but the query responses are always empty



Any advice is greatly appreciated.










share|improve this question























  • Do you have any updates on this? I also get empty responses...

    – rouge
    Dec 13 '18 at 12:40











  • @rouge Added an answer documenting what I've done so far.

    – sellmeadog
    Dec 13 '18 at 20:21











  • thanks, I just saw your post after I posted one by myself to the realm-forum: looks like I have the same problem: forum.realm.io/t/empty-result-for-query-with-graphql/2258

    – rouge
    Dec 14 '18 at 22:17
















2












2








2


1






I can successfully use the Realm GraphQL Client with a realm path like myInstance.us1.cloud.realm.io/~/realmName but when trying to use a global path, i.e., myinstance.us1.cloud.realm.io/realmName, I always get a 502 response from the server.



Any thoughts?



TLDR;



I have been fighting with getting data from a global/shared realm, i.e., no /~/ in the realm path with no luck. I always get a 502 Bad Gateway in response to executing a query. If I add the /~/ to the realm path, a connection is established and a new and empty user-specific realm is created (as expected) but then queries fail because the realm is empty (also expected).



Does the GraphQL Service provided by Realm Cloud support connecting to global/shared realms? I’ve skimmed over the source for both the server and client and did not see any specific reason why global/shared would not be supported.



I also tried passing isQueryBasedSync to the GraphQLConfig which results in a connection and successfully executed query, but the query responses are always empty



Any advice is greatly appreciated.










share|improve this question














I can successfully use the Realm GraphQL Client with a realm path like myInstance.us1.cloud.realm.io/~/realmName but when trying to use a global path, i.e., myinstance.us1.cloud.realm.io/realmName, I always get a 502 response from the server.



Any thoughts?



TLDR;



I have been fighting with getting data from a global/shared realm, i.e., no /~/ in the realm path with no luck. I always get a 502 Bad Gateway in response to executing a query. If I add the /~/ to the realm path, a connection is established and a new and empty user-specific realm is created (as expected) but then queries fail because the realm is empty (also expected).



Does the GraphQL Service provided by Realm Cloud support connecting to global/shared realms? I’ve skimmed over the source for both the server and client and did not see any specific reason why global/shared would not be supported.



I also tried passing isQueryBasedSync to the GraphQLConfig which results in a connection and successfully executed query, but the query responses are always empty



Any advice is greatly appreciated.







realm graphql realm-mobile-platform realm-js realm-cloud






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 21 '18 at 18:49









sellmeadogsellmeadog

6,08912135




6,08912135













  • Do you have any updates on this? I also get empty responses...

    – rouge
    Dec 13 '18 at 12:40











  • @rouge Added an answer documenting what I've done so far.

    – sellmeadog
    Dec 13 '18 at 20:21











  • thanks, I just saw your post after I posted one by myself to the realm-forum: looks like I have the same problem: forum.realm.io/t/empty-result-for-query-with-graphql/2258

    – rouge
    Dec 14 '18 at 22:17





















  • Do you have any updates on this? I also get empty responses...

    – rouge
    Dec 13 '18 at 12:40











  • @rouge Added an answer documenting what I've done so far.

    – sellmeadog
    Dec 13 '18 at 20:21











  • thanks, I just saw your post after I posted one by myself to the realm-forum: looks like I have the same problem: forum.realm.io/t/empty-result-for-query-with-graphql/2258

    – rouge
    Dec 14 '18 at 22:17



















Do you have any updates on this? I also get empty responses...

– rouge
Dec 13 '18 at 12:40





Do you have any updates on this? I also get empty responses...

– rouge
Dec 13 '18 at 12:40













@rouge Added an answer documenting what I've done so far.

– sellmeadog
Dec 13 '18 at 20:21





@rouge Added an answer documenting what I've done so far.

– sellmeadog
Dec 13 '18 at 20:21













thanks, I just saw your post after I posted one by myself to the realm-forum: looks like I have the same problem: forum.realm.io/t/empty-result-for-query-with-graphql/2258

– rouge
Dec 14 '18 at 22:17







thanks, I just saw your post after I posted one by myself to the realm-forum: looks like I have the same problem: forum.realm.io/t/empty-result-for-query-with-graphql/2258

– rouge
Dec 14 '18 at 22:17














1 Answer
1






active

oldest

votes


















0














I got past the 502 Bad Gateway error using the undocumented API(s) shown below (I had to find them by reading the current code in the realm-graphql repo):



const credentials = Credentials.usernamePassword(<username>, <password>);
const user = await User.authenticate(credentials, <server>);
const config = await GraphQLConfig.create(user, <realm_name>, undefined, false);
const client = config.createApolloClient();


However, I now frequently receive the following error during GraphQLConfig.create execution:




network timeout at: https://.cloud.realm.io/auth




Additionally, I posted this question on the Realm Forums that you may want to follow and received the following response:




Getting a 502 in the GraphQL service usually means you were trying to open a very large Realm that runs into some resourcing limits.




I am still waiting for more information from the Realm team and will update this answer accordingly.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53418744%2fuse-realm-graphql-client-with-a-global-shared-realm-in-realm-cloud%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I got past the 502 Bad Gateway error using the undocumented API(s) shown below (I had to find them by reading the current code in the realm-graphql repo):



    const credentials = Credentials.usernamePassword(<username>, <password>);
    const user = await User.authenticate(credentials, <server>);
    const config = await GraphQLConfig.create(user, <realm_name>, undefined, false);
    const client = config.createApolloClient();


    However, I now frequently receive the following error during GraphQLConfig.create execution:




    network timeout at: https://.cloud.realm.io/auth




    Additionally, I posted this question on the Realm Forums that you may want to follow and received the following response:




    Getting a 502 in the GraphQL service usually means you were trying to open a very large Realm that runs into some resourcing limits.




    I am still waiting for more information from the Realm team and will update this answer accordingly.






    share|improve this answer




























      0














      I got past the 502 Bad Gateway error using the undocumented API(s) shown below (I had to find them by reading the current code in the realm-graphql repo):



      const credentials = Credentials.usernamePassword(<username>, <password>);
      const user = await User.authenticate(credentials, <server>);
      const config = await GraphQLConfig.create(user, <realm_name>, undefined, false);
      const client = config.createApolloClient();


      However, I now frequently receive the following error during GraphQLConfig.create execution:




      network timeout at: https://.cloud.realm.io/auth




      Additionally, I posted this question on the Realm Forums that you may want to follow and received the following response:




      Getting a 502 in the GraphQL service usually means you were trying to open a very large Realm that runs into some resourcing limits.




      I am still waiting for more information from the Realm team and will update this answer accordingly.






      share|improve this answer


























        0












        0








        0







        I got past the 502 Bad Gateway error using the undocumented API(s) shown below (I had to find them by reading the current code in the realm-graphql repo):



        const credentials = Credentials.usernamePassword(<username>, <password>);
        const user = await User.authenticate(credentials, <server>);
        const config = await GraphQLConfig.create(user, <realm_name>, undefined, false);
        const client = config.createApolloClient();


        However, I now frequently receive the following error during GraphQLConfig.create execution:




        network timeout at: https://.cloud.realm.io/auth




        Additionally, I posted this question on the Realm Forums that you may want to follow and received the following response:




        Getting a 502 in the GraphQL service usually means you were trying to open a very large Realm that runs into some resourcing limits.




        I am still waiting for more information from the Realm team and will update this answer accordingly.






        share|improve this answer













        I got past the 502 Bad Gateway error using the undocumented API(s) shown below (I had to find them by reading the current code in the realm-graphql repo):



        const credentials = Credentials.usernamePassword(<username>, <password>);
        const user = await User.authenticate(credentials, <server>);
        const config = await GraphQLConfig.create(user, <realm_name>, undefined, false);
        const client = config.createApolloClient();


        However, I now frequently receive the following error during GraphQLConfig.create execution:




        network timeout at: https://.cloud.realm.io/auth




        Additionally, I posted this question on the Realm Forums that you may want to follow and received the following response:




        Getting a 502 in the GraphQL service usually means you were trying to open a very large Realm that runs into some resourcing limits.




        I am still waiting for more information from the Realm team and will update this answer accordingly.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 13 '18 at 20:21









        sellmeadogsellmeadog

        6,08912135




        6,08912135
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53418744%2fuse-realm-graphql-client-with-a-global-shared-realm-in-realm-cloud%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            這個網誌中的熱門文章

            Tangent Lines Diagram Along Smooth Curve

            Yusuf al-Mu'taman ibn Hud

            Zucchini