title: GraphQL Angular : Query result mapping
body: <p>Having</p>
  <pre class="lang-js prettyprint-override"><code>public getDoseStacked(param: String) : Observable&lt;DoseStackedApi&gt; {
  return this.apollo.watchQuery&lt;Query&gt;({
          query: this.STACKED,
          variables: {
            param : param
          }
      }).valueChanges
      .pipe(
        map(result =&gt; {
          // 1
          console.log(&quot;&gt;&gt; result.data = &quot; + JSON.stringify(result.data));
          // 2
          console.log(&quot;&gt;&gt; result.data.doseStackedApi= &quot; + JSON.stringify(result.data.doseStackedApi));
          return result.data.doseStackedApi;
        }
        ));
      }
  </code></pre>
  <p>With Query defined as follow :</p>
  <pre class="lang-js prettyprint-override"><code>export type Query = {
    doseStackedApi : DoseStackedApi;
  };
  
  export type DoseStackedApi = {
    periods   : string[];
    areas     : DoseStackedMap[];
    columns   : DoseStackedMap[];
  };
  
  export type DoseStackedMap = {
    doseName  : string;
    items     : DoseStackedDto[];
  };
  
  export type DoseStackedDto = {
    period    : string;
    totalDose : number;
  };
  </code></pre>
  <p>The log [1] display:</p>
  <pre><code>result.data = {&quot;doseStacked&quot;:{&quot;__typename&quot;:&quot;DoseStackedApi&quot;,
  &quot;periods&quot;:[&quot;2020-12-28&quot;,&quot;2021-01-04&quot;],
  &quot;areas&quot;:[{&quot;__typename&quot;:&quot;DoseStackedMap&quot;,&quot;doseName&quot;:&quot;1&quot;,
  &quot;items&quot;:[{&quot;__typename&quot;:&quot;DoseStackedDto&quot;,&quot;totalDose&quot;:0,&quot;period&quot;:&quot;2020-12-28&quot;},...
  </code></pre>
  <p>But log [2] display <code>result.data.doseStackedApi = undefined</code> while I would have expect :</p>
  <pre><code>result.data.doseStackedApi = &quot;periods&quot;:[&quot;2020-12-28&quot;,&quot;2021-01-04&quot;],&quot;areas&quot;:
  [{&quot;__typename&quot;:&quot;DoseStackedMap&quot;,&quot;doseName&quot;:&quot;1&quot;,&quot;items&quot;:
  [{&quot;__typename&quot;:&quot;DoseStackedDto&quot;,&quot;totalDose&quot;:0,&quot;period&quot;:&quot;2020-12-28&quot;},
  ...
  </code></pre>
  <p>What could be possibly wrong ?</p>