Forum Discussion

mogranovitch's avatar
mogranovitch
Occasional Contributor
4 years ago

Using GraphQL without ability to point to a schema file

Guys,

 

I have a problem to create a project that would work with multiple GraphQL API's in different environments - using ReadyAPI 3.5.1.

I can run individual GraphQL test requests fine with hard coded URL, but when I tried to add GraphQL API to the project (to use environment features) I'm blocked b/c I do not have access to the schema files - besides schemas are changing pretty frequently.

 

Two questions:

1. Is there a way to add GraphQL API to the project using End Point and Token to read the schema? Other applications like Altair doing that fine, but for some reason I do not see this option in ReadyAPI.

2. If #1 does not work, can I use for GraphQL's test requests an environment OR project property to specify URL for the GraphQL request for each environment?

  • NBorovykh's avatar
    NBorovykh
    4 years ago

    Hi Mikhail,

     

    Thank you for the clarifications.

    I'm afraid there is no much I can suggest for testing your scenario in ReadyAPI before GraphQL introspection (and auto-updating the cached schema) is supported. 

    I've already relayed this to the Product Team so that they could consider these GraphQL support improvements for future versions.

     

     

  • Hi mogranovitch,

     

    Thank you for your interest in GraphQL support in ReadyAPI. Here are answers to your questions:

    1. What you're looking for is the possibility to perform introspection against the GraphQL endpoint. Currently, this is not supported by ReadyAPI and the only way to provide your GraphQL API schema to ReadyAPI is to import a GraphQL SDL file either from the local drive or from the URL (if no authentication is required to access this file). I'll bring your interest in the introspection support to our Product Team's attention.

    2. In ReadyAPI for each environment you can specify a new endpoint for your GraphQL interface as it's shown in the image below. If this is not what you're looking for, please clarify your question. 

    • mogranovitch's avatar
      mogranovitch
      Occasional Contributor

      Hi NBorovyh, Natalie,

       

      Thank you for your reply to my question.

       

      For #1 - that is unfortunate since other tools I'm using doing that (read schema with provided end point and security token) fine.

      For #2 - Few comments:

      1. I'm dealing with multiple sub-systems that do not provide access to their schemas to me and without that I cannot create API and therefore I'm unable to change end-points for each environment as you suggested.
      2. Even if I had access to their schema it would be a huge maintenance nightmare for me to track if any changes are done for any of the schemas - again, this info is not available for me.

      Best regards,

      Mikhail

      • NBorovykh's avatar
        NBorovykh
        Moderator

        Hi Mikhail,

         

        Thank you for the clarifications.

        I'm afraid there is no much I can suggest for testing your scenario in ReadyAPI before GraphQL introspection (and auto-updating the cached schema) is supported. 

        I've already relayed this to the Product Team so that they could consider these GraphQL support improvements for future versions.