title: Is there a workaround for Converting from <operationQuery.Data> to Data type?
body: <h2>Language:Swift</h2>
  <p>Hello, I'd like some in resolving an error being thrown when I try to retrieve data from an Apollo GraphQL request that I'm making. The API in use is the AniList API utilizing GraphQL.</p>
  <p>Here's what I've tried:
  In my model I'm making the Apollo GraphQL query inside of a search() function. I want to then use the Codable protocol to fill an array of anime objects. Currently it's setup to return just for 1 anime object. I was planning on using this anime list as a data set for TableView later. I wanted to take small steps so my current goal is to at least get the Codable protocol to work and return the response data to an anime Struct object.</p>
  <p>The documentation for Apollo shows how to get individual fields but when I try to get the corresponding fields from my response , I don't even have the option.</p>
  <pre><code>func search(){
          Network.shared.apollo.fetch(query: AnisearchQuery()){
              result in
              guard let data = try? result.get().data else { return }
              
              var topData:APIResponse?
              do{
                  topData = JSONDecoder().decode(APIResponse.self, from: data.self)
              }catch{
                  
              }
              
          }
      }
  </code></pre>
  <p>Here are the data structures that I've set up as a representation of the JSON data I expect to receive with respect to the hierarchy it is laid out in the response.</p>
  <pre><code>struct APIResponse:Codable{
      let data:data
  }
  
  struct data:Codable{
      let Page:page
      let media:media
  }
  
  struct media:Codable{
      let animeResults:anime
  }
  struct anime:Codable{
      var romaji:String
      var english: String
      var native:String
      var episodes:Int
      var duration:Int
      var medium:String
  }
  </code></pre>
  <p>Here is the error in question.
  &quot;Cannot convert value of type 'AnisearchQuery.Data' to expected argument type 'Data'&quot;. This is generated by this line of code</p>
  <p><code> topData = JSONDecoder().decode(APIResponse.self, from: data.self)</code>
  For further context , AnisearchQuery.Data is generated in response to the query I created for the codgen.</p>
  <p><a href="https://i.stack.imgur.com/p5Ec1.png" rel="nofollow noreferrer">Here's what the data would look like in JSON format</a></p>
  <p>This is the setup of the query:</p>
  <pre><code>query anisearch($page:Int, $perPage:Int, $search:String){
      Page (page:$page, perPage:$perPage){
          pageInfo {
              total
              currentPage
              lastPage
              hasNextPage
              perPage
          }
          media(search:$search){
              title{
                  romaji
                  english
                  native
              }
              episodes
              duration
              coverImage{
                  medium
              }
          }
      }
  }
  </code></pre>
  <p>Here's the Data object in the API.swift file:</p>
  <pre><code>public struct Data: GraphQLSelectionSet {
      public static let possibleTypes: [String] = [&quot;Query&quot;]
  
      public static var selections: [GraphQLSelection] {
        return [
          GraphQLField(&quot;Page&quot;, arguments: [&quot;page&quot;: GraphQLVariable(&quot;page&quot;), &quot;perPage&quot;: GraphQLVariable(&quot;perPage&quot;)], type: .object(Page.selections)),
        ]
      }
  </code></pre>
  <p>I'd be open to any alternative methods as to getting this task done or perhaps fixes to the error being thrown.
  Many thanks in advance.</p>