from gql import gql, Client
      from gql.transport.aiohttp import AIOHTTPTransport
      
      # Select your transport with a defined url endpoint
      transport = AIOHTTPTransport(url="endpoint")
      # Create a GraphQL client using the defined transport
      client = Client(transport=transport, fetch_schema_from_transport=True)
      # Provide a GraphQL query
      query = gql(
      """
        query getNumberOfRecipesCount {
          assistantPublicRecipesCount
        }
      """
      )
      # Execute the query on the transport
      result = client.execute(query)
      print(result)
      

      Python language logo
      Simple GraphQL request

      gql
      GraphQL client and Python

      Perform a simple GraphQL query with gql in Python.

      Shortcut: gql.query

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.