master 6b7bfaf0138f cached
46 files
68.2 KB
18.6k tokens
118 symbols
1 requests
Download .txt
Repository: arjunyel/angular-spacex-graphql-codegen
Branch: master
Commit: 6b7bfaf0138f
Files: 46
Total size: 68.2 KB

Directory structure:
gitextract_i8_mwi3q/

├── .editorconfig
├── .gitignore
├── LICENSE
├── README.md
├── angular.json
├── apollo.config.js
├── browserslist
├── codegen.yml
├── e2e/
│   ├── protractor.conf.js
│   ├── src/
│   │   ├── app.e2e-spec.ts
│   │   └── app.po.ts
│   └── tsconfig.json
├── karma.conf.js
├── package.json
├── src/
│   ├── app/
│   │   ├── app-routing.module.ts
│   │   ├── app.component.css
│   │   ├── app.component.html
│   │   ├── app.component.spec.ts
│   │   ├── app.component.ts
│   │   ├── app.module.ts
│   │   ├── graphql.module.ts
│   │   ├── launch-details/
│   │   │   ├── launch-details.component.css
│   │   │   ├── launch-details.component.html
│   │   │   ├── launch-details.component.spec.ts
│   │   │   ├── launch-details.component.ts
│   │   │   └── launch-details.graphql
│   │   ├── launch-list/
│   │   │   ├── launch-list.component.css
│   │   │   ├── launch-list.component.html
│   │   │   ├── launch-list.component.spec.ts
│   │   │   ├── launch-list.component.ts
│   │   │   └── launch-list.graphql
│   │   ├── relative-time/
│   │   │   ├── relative-time.pipe.spec.ts
│   │   │   └── relative-time.pipe.ts
│   │   └── services/
│   │       └── spacexGraphql.service.ts
│   ├── assets/
│   │   └── .gitkeep
│   ├── environments/
│   │   ├── environment.prod.ts
│   │   └── environment.ts
│   ├── index.html
│   ├── main.ts
│   ├── polyfills.ts
│   ├── styles.css
│   └── test.ts
├── tsconfig.app.json
├── tsconfig.json
├── tsconfig.spec.json
└── tslint.json

================================================
FILE CONTENTS
================================================

================================================
FILE: .editorconfig
================================================
# Editor configuration, see https://editorconfig.org
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false


================================================
FILE: .gitignore
================================================
# See http://help.github.com/ignore-files/ for more about ignoring files.

# compiled output
/dist
/tmp
/out-tsc
# Only exists if Bazel was run
/bazel-out

# dependencies
/node_modules

# profiling files
chrome-profiler-events*.json
speed-measure-plugin*.json

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings

# System Files
.DS_Store
Thumbs.db


================================================
FILE: LICENSE
================================================
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org>


================================================
FILE: README.md
================================================
# Angular Spacex Graphql Codegen

## Mission

Our goal is to make an Angular app with a list of the past SpaceX launches along with an associated details page. Data is provided via the [SpaceX GraphQL API](https://medium.com/open-graphql/launching-spacex-graphql-api-b3d7029086e0) and Angular services are generated via [GraphQL Code Generator](https://graphql-code-generator.com/). We use [Apollo Angular](https://www.apollographql.com/docs/angular/) to access data from the frontend. The API is free so please be nice and don't abuse it.

## End Result

![List view](list-example.jpg)

![Details view](details-example.jpg)

## Steps

1. Generate a new angular application with routing

   ```bash
   ng new angular-spacex-graphql-codegen --routing=true --style=css
   ```

   Make sure to delete the default template in `src/app/app.component.html`

1. Install the [Apollo VS Code plugin](https://marketplace.visualstudio.com/items?itemName=apollographql.vscode-apollo) and in the root of the project add `apollo.config.js`

   ```javascript
   module.exports = {
     client: {
       service: {
         name: 'angular-spacex-graphql-codegen',
         url: 'https://api.spacex.land/graphql/'
       }
     }
   };
   ```

   This points the extension at the SpaceX GraphQL API so we get autocomplete, type information, and other cool features in GraphQL files. You may need to restart VS Code.

1. Generate our two components:

   ```bash
   ng g component launch-list --changeDetection=OnPush
   ```

   ```bash
   ng g component launch-details --changeDetection=OnPush
   ```

   Because our generated services use observables we choose OnPush change detection for the best performance.

1. In `src/app/app-routing.module.ts` we setup the routing:

   ```typescript
   import { LaunchListComponent } from './launch-list/launch-list.component';
   import { LaunchDetailsComponent } from './launch-details/launch-details.component';

   const routes: Routes = [
     {
       path: '',
       component: LaunchListComponent
     },
     {
       path: ':id',
       component: LaunchDetailsComponent
     }
   ];
   ```

1. Each component will have its own data requirments so we co-locate our graphql query files next to them

   ```graphql
   # src/app/launch-list/launch-list.graphql

   query pastLaunchesList($limit: Int!) {
     launchesPast(limit: $limit) {
       id
       mission_name
       links {
         flickr_images
         mission_patch_small
       }
       rocket {
         rocket_name
       }
       launch_date_utc
     }
   }
   ```

   ```graphql
   # src/app/launch-details/launch-details.graphql

   query launchDetails($id: ID!) {
     launch(id: $id) {
       id
       mission_name
       details
       links {
         flickr_images
         mission_patch
       }
     }
   }
   ```

   Note the first line: `query launchDetails($id: ID!)` When we generate the Angular service the query name is turned into PascalCase and GQL is appended to the end, so the service name for the launch details would be LaunchDetailsGQL. Also in the first line we define any variables we'll need to pass into the query. Please note it's import to include id in the query return so apollo can cache the data.

1. We add [Apollo Angular](https://www.apollographql.com/docs/angular/) to our app with `ng add apollo-angular`. In `src/app/graphql.module.ts` we set our API url `const uri = 'https://api.spacex.land/graphql/';`.

1. Install Graphql Code Generator and the needed plugins `npm i --save-dev @graphql-codegen/cli @graphql-codegen/typescript @graphql-codegen/typescript-apollo-angular @graphql-codegen/typescript-operations`

1. In the root of the project create a `codegen.yml` file:

   ```yml
   # Where to get schema data
   schema:
     - https://api.spacex.land/graphql/
   # The client side queries to turn into services
   documents:
     - src/**/*.graphql
   # Where to output the services and the list of plugins
   generates:
     ./src/app/services/spacexGraphql.service.ts:
       plugins:
         - typescript
         - typescript-operations
         - typescript-apollo-angular
   ```

1. In package.json add a script `"codegen": "gql-gen"` then `npm run codegen` to generate the Angular Services.

1. To make it look nice we add Angular Material `ng add @angular/material` then in the `app.module.ts` we import the card module and add to the imports array: `import { MatCardModule } from '@angular/material/card';`

1. Lets start with the list of past launches displayed on the screen:

   ```typescript
   import { map } from 'rxjs/operators';
   import { PastLaunchesListGQL } from '../services/spacexGraphql.service';

   export class LaunchListComponent {
     constructor(private readonly pastLaunchesService: PastLaunchesListGQL) {}

     // Please be careful to not fetch too much, but this amount lets us see lazy loading imgs in action
     pastLaunches$ = this.pastLaunchesService
       .fetch({ limit: 30 })
       // Here we extract our query data, we can also get info like errors or loading state from res
       .pipe(map((res) => res.data.launchesPast));
   }
   ```

   ```html
   <ng-container *ngIf="pastLaunches$ | async as pastLaunches">
     <main>
       <section class="container">
         <mat-card
           *ngFor="let launch of pastLaunches"
           [routerLink]="['/', launch.id]"
         >
           <mat-card-header>
             <img
               height="50"
               width="50"
               mat-card-avatar
               loading="lazy"
               [src]="launch.links.mission_patch_small"
               alt="Mission patch of {{ launch.mission_name }}"
             />
             <mat-card-title>{{ launch.mission_name }}</mat-card-title>
             <mat-card-subtitle
               >{{ launch.rocket.rocket_name }}</mat-card-subtitle
             >
           </mat-card-header>
           <img
             height="300"
             width="300"
             mat-card-image
             loading="lazy"
             [src]="launch.links.flickr_images[0]"
             alt="Photo of {{ launch.mission_name }}"
           />
         </mat-card>
       </section>
     </main>
   </ng-container>
   ```

   Notice the cool addition of [lazy loading images](https://web.dev/native-lazy-loading), if you emulate a mobile device in Chrome and fetch enough launches you should see the images lazy load while you scroll!

   To make it look nice we add CSS Grid

   ```css
   .container {
     padding-top: 20px;
     display: grid;
     grid-gap: 30px;
     grid-template-columns: repeat(auto-fill, 350px);
     justify-content: center;
   }

   .mat-card {
     cursor: pointer;
   }
   ```

1. Next we make the details page for a launch, we get the id from the route params and pass that to our service

   ```typescript
   import { ActivatedRoute } from '@angular/router';
   import { map, switchMap } from 'rxjs/operators';
   import { LaunchDetailsGQL } from '../services/spacexGraphql.service';

   export class LaunchDetailsComponent {
     constructor(
       private readonly route: ActivatedRoute,
       private readonly launchDetailsService: LaunchDetailsGQL
     ) {}

     launchDetails$ = this.route.paramMap.pipe(
       map((params) => params.get('id') as string),
       switchMap((id) => this.launchDetailsService.fetch({ id })),
       map((res) => res.data.launch)
     );
   }
   ```

   The HTML looks very similar to the list of launches

   ```html
   <ng-container *ngIf="launchDetails$ | async as launchDetails">
     <section style="padding-top: 20px;">
       <mat-card style="width: 400px; margin: auto;">
         <mat-card-header>
           <mat-card-title>{{ launchDetails.mission_name }}</mat-card-title>
         </mat-card-header>
         <img
           height="256"
           width="256"
           mat-card-image
           [src]="launchDetails.links.mission_patch"
           alt="Mission patch of {{ launchDetails.mission_name }}"
         />
         <mat-card-content>
           <p>{{ launchDetails.details }}</p>
         </mat-card-content>
       </mat-card>
     </section>
     <section class="photo-grid">
       <img
         *ngFor="let pic of launchDetails.links.flickr_images"
         [src]="pic"
         alt="Picture of {{ launchDetails.mission_name }}"
         height="300"
         width="300"
         loading="lazy"
       />
     </section>
   </ng-container>
   ```

   Finally we add CSS Grid for the pictures

   ```css
   .photo-grid {
     padding-top: 30px;
     display: grid;
     grid-gap: 10px;
     grid-template-columns: repeat(auto-fill, 300px);
     justify-content: center;
   }
   ```

1. `npm start`, navigate to `http://localhost:4200/`, and it should work!

### Extra Credit: Relative launch times

Thanks to the new builtin [relative time formating](https://v8.dev/features/intl-relativetimeformat) in V8, we can add `launched x days ago`

1. Generate the pipe: `ng g pipe relative-time --module=app.module --flat=false`

1. The pipe takes in the UTC time and returns a formatted string

   ```typescript
   import { Pipe, PipeTransform } from '@angular/core';

   const milliSecondsInDay = 1000 * 3600 * 24;

   // Cast as any because typescript typing haven't updated yet
   const rtf = new (Intl as any).RelativeTimeFormat('en');

   @Pipe({
     name: 'relativeTime'
   })
   export class RelativeTimePipe implements PipeTransform {
     transform(utcTime: string): string {
       const diffInMillicseconds =
         new Date(utcTime).getTime() - new Date().getTime();
       const diffInDays = Math.round(diffInMillicseconds / milliSecondsInDay);
       return rtf.format(diffInDays, 'day');
     }
   }
   ```

1. Add the pipe to our launch card in src/app/launch-list/launch-list.component.html

   ```html
   <mat-card-subtitle
     >{{ launch.rocket.rocket_name }} - launched {{ launch.launch_date_utc |
     relativeTime }}</mat-card-subtitle
   >
   ```


================================================
FILE: angular.json
================================================
{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "angular-spacex-graphql-codegen": {
      "projectType": "application",
      "schematics": {},
      "root": "",
      "sourceRoot": "src",
      "prefix": "app",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist/angular-spacex-graphql-codegen",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "tsconfig.app.json",
            "aot": false,
            "assets": [
              "src/favicon.ico",
              "src/assets"
            ],
            "styles": [
              "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
              "src/styles.css"
            ],
            "scripts": []
          },
          "configurations": {
            "production": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ],
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "2mb",
                  "maximumError": "5mb"
                },
                {
                  "type": "anyComponentStyle",
                  "maximumWarning": "6kb",
                  "maximumError": "10kb"
                }
              ]
            }
          }
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "angular-spacex-graphql-codegen:build"
          },
          "configurations": {
            "production": {
              "browserTarget": "angular-spacex-graphql-codegen:build:production"
            }
          }
        },
        "extract-i18n": {
          "builder": "@angular-devkit/build-angular:extract-i18n",
          "options": {
            "browserTarget": "angular-spacex-graphql-codegen:build"
          }
        },
        "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "src/test.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "tsconfig.spec.json",
            "karmaConfig": "karma.conf.js",
            "assets": [
              "src/favicon.ico",
              "src/assets"
            ],
            "styles": [
              "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
              "src/styles.css"
            ],
            "scripts": []
          }
        },
        "lint": {
          "builder": "@angular-devkit/build-angular:tslint",
          "options": {
            "tsConfig": [
              "tsconfig.app.json",
              "tsconfig.spec.json",
              "e2e/tsconfig.json"
            ],
            "exclude": [
              "**/node_modules/**"
            ]
          }
        },
        "e2e": {
          "builder": "@angular-devkit/build-angular:protractor",
          "options": {
            "protractorConfig": "e2e/protractor.conf.js",
            "devServerTarget": "angular-spacex-graphql-codegen:serve"
          },
          "configurations": {
            "production": {
              "devServerTarget": "angular-spacex-graphql-codegen:serve:production"
            }
          }
        }
      }
    }
  },
  "defaultProject": "angular-spacex-graphql-codegen"
}

================================================
FILE: apollo.config.js
================================================
module.exports = {
  client: {
    service: {
      name: 'angular-spacex-graphql-codegen',
      url: 'https://api.spacex.land/graphql/'
    }
  }
};


================================================
FILE: browserslist
================================================
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
# For additional information regarding the format and rule options, please see:
# https://github.com/browserslist/browserslist#queries

# You can see what browsers were selected by your queries by running:
#   npx browserslist

> 0.5%
last 2 versions
Firefox ESR
not dead
not IE 9-11 # For IE 9-11 support, remove 'not'.

================================================
FILE: codegen.yml
================================================
# Where to get schema data
schema:
  - https://api.spacex.land/graphql/
# The client side queries to turn into services
documents:
  - src/**/*.graphql
# Where to output the services and the list of plugins
generates:
  ./src/app/services/spacexGraphql.service.ts:
    plugins:
      - typescript
      - typescript-operations
      - typescript-apollo-angular


================================================
FILE: e2e/protractor.conf.js
================================================
// @ts-check
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts

const { SpecReporter } = require('jasmine-spec-reporter');

/**
 * @type { import("protractor").Config }
 */
exports.config = {
  allScriptsTimeout: 11000,
  specs: [
    './src/**/*.e2e-spec.ts'
  ],
  capabilities: {
    'browserName': 'chrome'
  },
  directConnect: true,
  baseUrl: 'http://localhost:4200/',
  framework: 'jasmine',
  jasmineNodeOpts: {
    showColors: true,
    defaultTimeoutInterval: 30000,
    print: function() {}
  },
  onPrepare() {
    require('ts-node').register({
      project: require('path').join(__dirname, './tsconfig.json')
    });
    jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
  }
};

================================================
FILE: e2e/src/app.e2e-spec.ts
================================================
import { AppPage } from './app.po';
import { browser, logging } from 'protractor';

describe('workspace-project App', () => {
  let page: AppPage;

  beforeEach(() => {
    page = new AppPage();
  });

  it('should display welcome message', () => {
    page.navigateTo();
    expect(page.getTitleText()).toEqual('angular-spacex-graphql-codegen app is running!');
  });

  afterEach(async () => {
    // Assert that there are no errors emitted from the browser
    const logs = await browser.manage().logs().get(logging.Type.BROWSER);
    expect(logs).not.toContain(jasmine.objectContaining({
      level: logging.Level.SEVERE,
    } as logging.Entry));
  });
});


================================================
FILE: e2e/src/app.po.ts
================================================
import { browser, by, element } from 'protractor';

export class AppPage {
  navigateTo() {
    return browser.get(browser.baseUrl) as Promise<any>;
  }

  getTitleText() {
    return element(by.css('app-root .content span')).getText() as Promise<string>;
  }
}


================================================
FILE: e2e/tsconfig.json
================================================
{
  "extends": "../tsconfig.json",
  "compilerOptions": {
    "outDir": "../out-tsc/e2e",
    "module": "commonjs",
    "target": "es5",
    "types": [
      "jasmine",
      "jasminewd2",
      "node"
    ]
  }
}


================================================
FILE: karma.conf.js
================================================
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

module.exports = function (config) {
  config.set({
    basePath: '',
    frameworks: ['jasmine', '@angular-devkit/build-angular'],
    plugins: [
      require('karma-jasmine'),
      require('karma-chrome-launcher'),
      require('karma-jasmine-html-reporter'),
      require('karma-coverage-istanbul-reporter'),
      require('@angular-devkit/build-angular/plugins/karma')
    ],
    client: {
      clearContext: false // leave Jasmine Spec Runner output visible in browser
    },
    coverageIstanbulReporter: {
      dir: require('path').join(__dirname, './coverage/angular-spacex-graphql-codegen'),
      reports: ['html', 'lcovonly', 'text-summary'],
      fixWebpackSourcePaths: true
    },
    reporters: ['progress', 'kjhtml'],
    port: 9876,
    colors: true,
    logLevel: config.LOG_INFO,
    autoWatch: true,
    browsers: ['Chrome'],
    singleRun: false,
    restartOnFileChange: true
  });
};


================================================
FILE: package.json
================================================
{
  "name": "angular-spacex-graphql-codegen",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve --aot",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "codegen": "gql-gen"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "~8.2.5",
    "@angular/cdk": "~8.2.0",
    "@angular/common": "~8.2.5",
    "@angular/compiler": "~8.2.5",
    "@angular/core": "~8.2.5",
    "@angular/forms": "~8.2.5",
    "@angular/material": "^8.2.0",
    "@angular/platform-browser": "~8.2.5",
    "@angular/platform-browser-dynamic": "~8.2.5",
    "@angular/router": "~8.2.5",
    "apollo-angular": "^1.7.0",
    "apollo-angular-link-http": "^1.8.0",
    "apollo-cache-inmemory": "^1.6.3",
    "apollo-client": "^2.6.4",
    "apollo-link": "^1.2.13",
    "graphql": "^14.5.5",
    "graphql-tag": "^2.10.1",
    "hammerjs": "^2.0.8",
    "rxjs": "~6.4.0",
    "tslib": "^1.10.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.803.4",
    "@angular/cli": "~8.3.4",
    "@angular/compiler-cli": "~8.2.5",
    "@angular/language-service": "~8.2.5",
    "@graphql-codegen/cli": "^1.7.0",
    "@graphql-codegen/typescript": "^1.7.0",
    "@graphql-codegen/typescript-apollo-angular": "^1.7.0",
    "@graphql-codegen/typescript-operations": "^1.7.0",
    "@types/jasmine": "~3.3.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "^5.0.0",
    "jasmine-core": "~3.4.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.4.0",
    "protractor": "~5.4.0",
    "ts-node": "~7.0.0",
    "tslint": "~5.15.0",
    "typescript": "~3.5.3"
  }
}


================================================
FILE: src/app/app-routing.module.ts
================================================
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { LaunchListComponent } from './launch-list/launch-list.component';
import { LaunchDetailsComponent } from './launch-details/launch-details.component';

const routes: Routes = [
  {
    path: '',
    component: LaunchListComponent
  },
  {
    path: ':id',
    component: LaunchDetailsComponent
  }
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule {}


================================================
FILE: src/app/app.component.css
================================================


================================================
FILE: src/app/app.component.html
================================================
<router-outlet></router-outlet>


================================================
FILE: src/app/app.component.spec.ts
================================================
import { TestBed, async } from '@angular/core/testing';
import { RouterTestingModule } from '@angular/router/testing';
import { AppComponent } from './app.component';

describe('AppComponent', () => {
  beforeEach(async(() => {
    TestBed.configureTestingModule({
      imports: [
        RouterTestingModule
      ],
      declarations: [
        AppComponent
      ],
    }).compileComponents();
  }));

  it('should create the app', () => {
    const fixture = TestBed.createComponent(AppComponent);
    const app = fixture.debugElement.componentInstance;
    expect(app).toBeTruthy();
  });

  it(`should have as title 'angular-spacex-graphql-codegen'`, () => {
    const fixture = TestBed.createComponent(AppComponent);
    const app = fixture.debugElement.componentInstance;
    expect(app.title).toEqual('angular-spacex-graphql-codegen');
  });

  it('should render title', () => {
    const fixture = TestBed.createComponent(AppComponent);
    fixture.detectChanges();
    const compiled = fixture.debugElement.nativeElement;
    expect(compiled.querySelector('.content span').textContent).toContain('angular-spacex-graphql-codegen app is running!');
  });
});


================================================
FILE: src/app/app.component.ts
================================================
import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'angular-spacex-graphql-codegen';
  test = new Date();
}


================================================
FILE: src/app/app.module.ts
================================================
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { LaunchListComponent } from './launch-list/launch-list.component';
import { LaunchDetailsComponent } from './launch-details/launch-details.component';
import { GraphQLModule } from './graphql.module';
import { HttpClientModule } from '@angular/common/http';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { MatCardModule } from '@angular/material/card';
import { RelativeTimePipe } from './relative-time/relative-time.pipe';

@NgModule({
  declarations: [AppComponent, LaunchListComponent, LaunchDetailsComponent, RelativeTimePipe],
  imports: [
    BrowserModule,
    AppRoutingModule,
    GraphQLModule,
    HttpClientModule,
    BrowserAnimationsModule,
    MatCardModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule {}


================================================
FILE: src/app/graphql.module.ts
================================================
import {NgModule} from '@angular/core';
import {ApolloModule, APOLLO_OPTIONS} from 'apollo-angular';
import {HttpLinkModule, HttpLink} from 'apollo-angular-link-http';
import {InMemoryCache} from 'apollo-cache-inmemory';

const uri = 'https://api.spacex.land/graphql/'; // <-- add the URL of the GraphQL server here
export function createApollo(httpLink: HttpLink) {
  return {
    link: httpLink.create({uri}),
    cache: new InMemoryCache(),
  };
}

@NgModule({
  exports: [ApolloModule, HttpLinkModule],
  providers: [
    {
      provide: APOLLO_OPTIONS,
      useFactory: createApollo,
      deps: [HttpLink],
    },
  ],
})
export class GraphQLModule {}


================================================
FILE: src/app/launch-details/launch-details.component.css
================================================
.photo-grid {
  padding-top: 30px;
  display: grid;
  grid-gap: 10px;
  grid-template-columns: repeat(auto-fill, 300px);
  justify-content: center;
}


================================================
FILE: src/app/launch-details/launch-details.component.html
================================================
<ng-container *ngIf="launchDetails$ | async as launchDetails">
  <section style="padding-top: 20px;">
    <mat-card style="width: 400px; margin: auto;">
      <mat-card-header>
        <mat-card-title>{{ launchDetails.mission_name }}</mat-card-title>
      </mat-card-header>
      <img
        height="256"
        width="256"
        mat-card-image
        [src]="launchDetails.links.mission_patch"
        alt="Mission patch of {{ launchDetails.mission_name }}"
      />
      <mat-card-content>
        <p>{{ launchDetails.details }}</p>
      </mat-card-content>
    </mat-card>
  </section>
  <section class="photo-grid">
    <img
      *ngFor="let pic of launchDetails.links.flickr_images"
      [src]="pic"
      alt="Picture of {{ launchDetails.mission_name }}"
      height="300"
      width="300"
      loading="lazy"
    />
  </section>
</ng-container>


================================================
FILE: src/app/launch-details/launch-details.component.spec.ts
================================================
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { LaunchDetailsComponent } from './launch-details.component';

describe('LaunchDetailsComponent', () => {
  let component: LaunchDetailsComponent;
  let fixture: ComponentFixture<LaunchDetailsComponent>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [ LaunchDetailsComponent ]
    })
    .compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(LaunchDetailsComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should create', () => {
    expect(component).toBeTruthy();
  });
});


================================================
FILE: src/app/launch-details/launch-details.component.ts
================================================
import { Component, ChangeDetectionStrategy } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { map, switchMap } from 'rxjs/operators';
import { LaunchDetailsGQL } from '../services/spacexGraphql.service';

@Component({
  selector: 'app-launch-details',
  templateUrl: './launch-details.component.html',
  styleUrls: ['./launch-details.component.css'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class LaunchDetailsComponent {
  constructor(
    private readonly route: ActivatedRoute,
    private readonly launchDetailsService: LaunchDetailsGQL
  ) {}

  launchDetails$ = this.route.paramMap.pipe(
    map((params) => params.get('id') as string),
    switchMap((id) => this.launchDetailsService.fetch({ id })),
    map((res) => res.data.launch)
  );
}


================================================
FILE: src/app/launch-details/launch-details.graphql
================================================
# src/app/launch-details/launch-details.frontend.graphql

query launchDetails($id: ID!) {
  launch(id: $id) {
    id
    mission_name
    details
    links {
      flickr_images
      mission_patch
    }
  }
}


================================================
FILE: src/app/launch-list/launch-list.component.css
================================================
.container {
  padding-top: 20px;
  display: grid;
  grid-gap: 30px;
  grid-template-columns: repeat(auto-fill, 350px);
  justify-content: center;
}

.mat-card {
  cursor: pointer;
}


================================================
FILE: src/app/launch-list/launch-list.component.html
================================================
<ng-container *ngIf="pastLaunches$ | async as pastLaunches">
  <main>
    <section class="container">
      <mat-card
        *ngFor="let launch of pastLaunches"
        [routerLink]="['/', launch.id]"
      >
        <mat-card-header>
          <img
            height="50"
            width="50"
            mat-card-avatar
            loading="lazy"
            [src]="launch.links.mission_patch_small"
            alt="Mission patch of {{ launch.mission_name }}"
          />
          <mat-card-title>{{ launch.mission_name }}</mat-card-title>
          <mat-card-subtitle
            >{{ launch.rocket.rocket_name }} - launched
            {{ launch.launch_date_utc | relativeTime }}</mat-card-subtitle
          >
        </mat-card-header>
        <img
          height="300"
          width="300"
          mat-card-image
          loading="lazy"
          [src]="launch.links.flickr_images[0]"
          alt="Photo of {{ launch.mission_name }}"
        />
      </mat-card>
    </section>
  </main>
</ng-container>


================================================
FILE: src/app/launch-list/launch-list.component.spec.ts
================================================
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { LaunchListComponent } from './launch-list.component';

describe('LaunchListComponent', () => {
  let component: LaunchListComponent;
  let fixture: ComponentFixture<LaunchListComponent>;

  beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [ LaunchListComponent ]
    })
    .compileComponents();
  }));

  beforeEach(() => {
    fixture = TestBed.createComponent(LaunchListComponent);
    component = fixture.componentInstance;
    fixture.detectChanges();
  });

  it('should create', () => {
    expect(component).toBeTruthy();
  });
});


================================================
FILE: src/app/launch-list/launch-list.component.ts
================================================
import { Component, ChangeDetectionStrategy } from '@angular/core';
import { map } from 'rxjs/operators';
import { PastLaunchesListGQL } from '../services/spacexGraphql.service';

@Component({
  selector: 'app-launch-list',
  templateUrl: './launch-list.component.html',
  styleUrls: ['./launch-list.component.css'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class LaunchListComponent {
  constructor(private readonly pastLaunchesService: PastLaunchesListGQL) {}

  pastLaunches$ = this.pastLaunchesService
    // Please be care to not fetch too much, but this amount lets us see the img lazy loading in action
    .fetch({ limit: 30 })
    .pipe(map((res) => res.data.launchesPast));
}


================================================
FILE: src/app/launch-list/launch-list.graphql
================================================
# src/app/launch-list/launch-list.graphql

query pastLaunchesList($limit: Int!) {
  launchesPast(limit: $limit) {
    id
    mission_name
    links {
      flickr_images
      mission_patch_small
    }
    rocket {
      rocket_name
    }
    launch_date_utc
  }
}


================================================
FILE: src/app/relative-time/relative-time.pipe.spec.ts
================================================
import { RelativeTimePipe } from './relative-time.pipe';

describe('RelativeTimePipe', () => {
  it('create an instance', () => {
    const pipe = new RelativeTimePipe();
    expect(pipe).toBeTruthy();
  });
});


================================================
FILE: src/app/relative-time/relative-time.pipe.ts
================================================
import { Pipe, PipeTransform } from '@angular/core';

const milliSecondsInDay = 1000 * 3600 * 24;

// Cast as any because typescript typing haven't updated yet
const rtf = new (Intl as any).RelativeTimeFormat('en');

@Pipe({
  name: 'relativeTime'
})
export class RelativeTimePipe implements PipeTransform {
  transform(utcTime: string): string {
    const diffInMillicseconds =
      new Date(utcTime).getTime() - new Date().getTime();
    const diffInDays = Math.round(diffInMillicseconds / milliSecondsInDay);
    return rtf.format(diffInDays, 'day');
  }
}


================================================
FILE: src/app/services/spacexGraphql.service.ts
================================================
import gql from 'graphql-tag';
import { Injectable } from '@angular/core';
import * as Apollo from 'apollo-angular';
export type Maybe<T> = T | null;
/** All built-in and custom scalars, mapped to their actual values */
export type Scalars = {
  ID: string,
  String: string,
  Boolean: boolean,
  Int: number,
  Float: number,
  Date: any,
  ObjectID: any,
};




export type Address = {
   __typename?: 'Address',
  address?: Maybe<Scalars['String']>,
  city?: Maybe<Scalars['String']>,
  state?: Maybe<Scalars['String']>,
};

export type Capsule = {
   __typename?: 'Capsule',
  id?: Maybe<Scalars['ID']>,
  landings?: Maybe<Scalars['Int']>,
  missions?: Maybe<Array<Maybe<CapsuleMission>>>,
  original_launch?: Maybe<Scalars['Date']>,
  reuse_count?: Maybe<Scalars['Int']>,
  status?: Maybe<Scalars['String']>,
  type?: Maybe<Scalars['String']>,
  dragon?: Maybe<Dragon>,
};

export type CapsuleMission = {
   __typename?: 'CapsuleMission',
  flight?: Maybe<Scalars['Int']>,
  name?: Maybe<Scalars['String']>,
};

export type CapsulesFind = {
  id?: Maybe<Scalars['ID']>,
  landings?: Maybe<Scalars['Int']>,
  mission?: Maybe<Scalars['String']>,
  original_launch?: Maybe<Scalars['Date']>,
  reuse_count?: Maybe<Scalars['Int']>,
  status?: Maybe<Scalars['String']>,
  type?: Maybe<Scalars['String']>,
};

export type Core = {
   __typename?: 'Core',
  asds_attempts?: Maybe<Scalars['Int']>,
  asds_landings?: Maybe<Scalars['Int']>,
  block?: Maybe<Scalars['Int']>,
  id?: Maybe<Scalars['ID']>,
  missions?: Maybe<Array<Maybe<CapsuleMission>>>,
  original_launch?: Maybe<Scalars['Date']>,
  reuse_count?: Maybe<Scalars['Int']>,
  rtls_attempts?: Maybe<Scalars['Int']>,
  rtls_landings?: Maybe<Scalars['Int']>,
  status?: Maybe<Scalars['String']>,
  water_landing?: Maybe<Scalars['Boolean']>,
};

export type CoreMission = {
   __typename?: 'CoreMission',
  name?: Maybe<Scalars['String']>,
  flight?: Maybe<Scalars['Int']>,
};

export type CoresFind = {
  asds_attempts?: Maybe<Scalars['Int']>,
  asds_landings?: Maybe<Scalars['Int']>,
  block?: Maybe<Scalars['Int']>,
  id?: Maybe<Scalars['String']>,
  missions?: Maybe<Scalars['String']>,
  original_launch?: Maybe<Scalars['Date']>,
  reuse_count?: Maybe<Scalars['Int']>,
  rtls_attempts?: Maybe<Scalars['Int']>,
  rtls_landings?: Maybe<Scalars['Int']>,
  status?: Maybe<Scalars['String']>,
  water_landing?: Maybe<Scalars['Boolean']>,
};


export type Distance = {
   __typename?: 'Distance',
  feet?: Maybe<Scalars['Float']>,
  meters?: Maybe<Scalars['Float']>,
};

export type Dragon = {
   __typename?: 'Dragon',
  active?: Maybe<Scalars['Boolean']>,
  crew_capacity?: Maybe<Scalars['Int']>,
  description?: Maybe<Scalars['String']>,
  diameter?: Maybe<Distance>,
  dry_mass_kg?: Maybe<Scalars['Int']>,
  dry_mass_lb?: Maybe<Scalars['Int']>,
  first_flight?: Maybe<Scalars['String']>,
  heat_shield?: Maybe<DragonHeatShield>,
  height_w_trunk?: Maybe<Distance>,
  id?: Maybe<Scalars['ID']>,
  launch_payload_mass?: Maybe<Mass>,
  launch_payload_vol?: Maybe<Volume>,
  name?: Maybe<Scalars['String']>,
  orbit_duration_yr?: Maybe<Scalars['Int']>,
  pressurized_capsule?: Maybe<DragonPressurizedCapsule>,
  return_payload_mass?: Maybe<Mass>,
  return_payload_vol?: Maybe<Volume>,
  sidewall_angle_deg?: Maybe<Scalars['Float']>,
  thrusters?: Maybe<Array<Maybe<DragonThrust>>>,
  trunk?: Maybe<DragonTrunk>,
  type?: Maybe<Scalars['String']>,
  wikipedia?: Maybe<Scalars['String']>,
};

export type DragonHeatShield = {
   __typename?: 'DragonHeatShield',
  dev_partner?: Maybe<Scalars['String']>,
  material?: Maybe<Scalars['String']>,
  size_meters?: Maybe<Scalars['Float']>,
  temp_degrees?: Maybe<Scalars['Int']>,
};

export type DragonPressurizedCapsule = {
   __typename?: 'DragonPressurizedCapsule',
  payload_volume?: Maybe<Volume>,
};

export type DragonThrust = {
   __typename?: 'DragonThrust',
  amount?: Maybe<Scalars['Int']>,
  fuel_1?: Maybe<Scalars['String']>,
  fuel_2?: Maybe<Scalars['String']>,
  pods?: Maybe<Scalars['Int']>,
  thrust?: Maybe<Force>,
  type?: Maybe<Scalars['String']>,
};

export type DragonTrunk = {
   __typename?: 'DragonTrunk',
  cargo?: Maybe<DragonTrunkCargo>,
  trunk_volume?: Maybe<Volume>,
};

export type DragonTrunkCargo = {
   __typename?: 'DragonTrunkCargo',
  solar_array?: Maybe<Scalars['Int']>,
  unpressurized_cargo?: Maybe<Scalars['Boolean']>,
};

export type Force = {
   __typename?: 'Force',
  kN?: Maybe<Scalars['Float']>,
  lbf?: Maybe<Scalars['Float']>,
};

export type HistoriesResult = {
   __typename?: 'HistoriesResult',
  result?: Maybe<Result>,
  data?: Maybe<Array<Maybe<History>>>,
};

export type History = {
   __typename?: 'History',
  details?: Maybe<Scalars['String']>,
  event_date_unix?: Maybe<Scalars['Date']>,
  event_date_utc?: Maybe<Scalars['Date']>,
  id?: Maybe<Scalars['ID']>,
  links?: Maybe<Link>,
  title?: Maybe<Scalars['String']>,
  flight?: Maybe<Launch>,
};

export type HistoryFind = {
  end?: Maybe<Scalars['Date']>,
  flight_number?: Maybe<Scalars['Int']>,
  id?: Maybe<Scalars['ID']>,
  start?: Maybe<Scalars['Date']>,
};

export type Info = {
   __typename?: 'Info',
  ceo?: Maybe<Scalars['String']>,
  coo?: Maybe<Scalars['String']>,
  cto_propulsion?: Maybe<Scalars['String']>,
  cto?: Maybe<Scalars['String']>,
  employees?: Maybe<Scalars['Int']>,
  founded?: Maybe<Scalars['Int']>,
  founder?: Maybe<Scalars['String']>,
  headquarters?: Maybe<Address>,
  launch_sites?: Maybe<Scalars['Int']>,
  links?: Maybe<InfoLinks>,
  name?: Maybe<Scalars['String']>,
  summary?: Maybe<Scalars['String']>,
  test_sites?: Maybe<Scalars['Int']>,
  valuation?: Maybe<Scalars['Float']>,
  vehicles?: Maybe<Scalars['Int']>,
};

export type InfoLinks = {
   __typename?: 'InfoLinks',
  elon_twitter?: Maybe<Scalars['String']>,
  flickr?: Maybe<Scalars['String']>,
  twitter?: Maybe<Scalars['String']>,
  website?: Maybe<Scalars['String']>,
};

export type Landpad = {
   __typename?: 'Landpad',
  attempted_landings?: Maybe<Scalars['String']>,
  details?: Maybe<Scalars['String']>,
  full_name?: Maybe<Scalars['String']>,
  id?: Maybe<Scalars['ID']>,
  landing_type?: Maybe<Scalars['String']>,
  location?: Maybe<Location>,
  status?: Maybe<Scalars['String']>,
  successful_landings?: Maybe<Scalars['String']>,
  wikipedia?: Maybe<Scalars['String']>,
};

export type Launch = {
   __typename?: 'Launch',
  details?: Maybe<Scalars['String']>,
  id?: Maybe<Scalars['ID']>,
  is_tentative?: Maybe<Scalars['Boolean']>,
  launch_date_local?: Maybe<Scalars['Date']>,
  launch_date_unix?: Maybe<Scalars['Date']>,
  launch_date_utc?: Maybe<Scalars['Date']>,
  launch_site?: Maybe<LaunchSite>,
  launch_success?: Maybe<Scalars['Boolean']>,
  launch_year?: Maybe<Scalars['String']>,
  links?: Maybe<LaunchLinks>,
  mission_id?: Maybe<Array<Maybe<Scalars['String']>>>,
  mission_name?: Maybe<Scalars['String']>,
  rocket?: Maybe<LaunchRocket>,
  static_fire_date_unix?: Maybe<Scalars['Date']>,
  static_fire_date_utc?: Maybe<Scalars['Date']>,
  telemetry?: Maybe<LaunchTelemetry>,
  tentative_max_precision?: Maybe<Scalars['String']>,
  upcoming?: Maybe<Scalars['Boolean']>,
  ships?: Maybe<Array<Maybe<Ship>>>,
};

export type LaunchesPastResult = {
   __typename?: 'LaunchesPastResult',
  result?: Maybe<Result>,
  data?: Maybe<Array<Maybe<Launch>>>,
};

export type LaunchFind = {
  apoapsis_km?: Maybe<Scalars['Float']>,
  block?: Maybe<Scalars['Int']>,
  cap_serial?: Maybe<Scalars['String']>,
  capsule_reuse?: Maybe<Scalars['String']>,
  core_flight?: Maybe<Scalars['Int']>,
  core_reuse?: Maybe<Scalars['String']>,
  core_serial?: Maybe<Scalars['String']>,
  customer?: Maybe<Scalars['String']>,
  eccentricity?: Maybe<Scalars['Float']>,
  end?: Maybe<Scalars['Date']>,
  epoch?: Maybe<Scalars['Date']>,
  fairings_recovered?: Maybe<Scalars['String']>,
  fairings_recovery_attempt?: Maybe<Scalars['String']>,
  fairings_reuse?: Maybe<Scalars['String']>,
  fairings_reused?: Maybe<Scalars['String']>,
  fairings_ship?: Maybe<Scalars['String']>,
  gridfins?: Maybe<Scalars['String']>,
  id?: Maybe<Scalars['ID']>,
  inclination_deg?: Maybe<Scalars['Float']>,
  land_success?: Maybe<Scalars['String']>,
  landing_intent?: Maybe<Scalars['String']>,
  landing_type?: Maybe<Scalars['String']>,
  landing_vehicle?: Maybe<Scalars['String']>,
  launch_date_local?: Maybe<Scalars['Date']>,
  launch_date_utc?: Maybe<Scalars['Date']>,
  launch_success?: Maybe<Scalars['String']>,
  launch_year?: Maybe<Scalars['String']>,
  legs?: Maybe<Scalars['String']>,
  lifespan_years?: Maybe<Scalars['Float']>,
  longitude?: Maybe<Scalars['Float']>,
  manufacturer?: Maybe<Scalars['String']>,
  mean_motion?: Maybe<Scalars['Float']>,
  mission_id?: Maybe<Scalars['String']>,
  mission_name?: Maybe<Scalars['String']>,
  nationality?: Maybe<Scalars['String']>,
  norad_id?: Maybe<Scalars['Int']>,
  orbit?: Maybe<Scalars['String']>,
  payload_id?: Maybe<Scalars['String']>,
  payload_type?: Maybe<Scalars['String']>,
  periapsis_km?: Maybe<Scalars['Float']>,
  period_min?: Maybe<Scalars['Float']>,
  raan?: Maybe<Scalars['Float']>,
  reference_system?: Maybe<Scalars['String']>,
  regime?: Maybe<Scalars['String']>,
  reused?: Maybe<Scalars['String']>,
  rocket_id?: Maybe<Scalars['String']>,
  rocket_name?: Maybe<Scalars['String']>,
  rocket_type?: Maybe<Scalars['String']>,
  second_stage_block?: Maybe<Scalars['String']>,
  semi_major_axis_km?: Maybe<Scalars['Float']>,
  ship?: Maybe<Scalars['String']>,
  side_core1_reuse?: Maybe<Scalars['String']>,
  side_core2_reuse?: Maybe<Scalars['String']>,
  site_id?: Maybe<Scalars['String']>,
  site_name_long?: Maybe<Scalars['String']>,
  site_name?: Maybe<Scalars['String']>,
  start?: Maybe<Scalars['Date']>,
  tbd?: Maybe<Scalars['String']>,
  tentative_max_precision?: Maybe<Scalars['String']>,
  tentative?: Maybe<Scalars['String']>,
};

export type LaunchLinks = {
   __typename?: 'LaunchLinks',
  article_link?: Maybe<Scalars['String']>,
  flickr_images?: Maybe<Array<Maybe<Scalars['String']>>>,
  mission_patch_small?: Maybe<Scalars['String']>,
  mission_patch?: Maybe<Scalars['String']>,
  presskit?: Maybe<Scalars['String']>,
  reddit_campaign?: Maybe<Scalars['String']>,
  reddit_launch?: Maybe<Scalars['String']>,
  reddit_media?: Maybe<Scalars['String']>,
  reddit_recovery?: Maybe<Scalars['String']>,
  video_link?: Maybe<Scalars['String']>,
  wikipedia?: Maybe<Scalars['String']>,
};

export type Launchpad = {
   __typename?: 'Launchpad',
  attempted_launches?: Maybe<Scalars['Int']>,
  details?: Maybe<Scalars['String']>,
  id?: Maybe<Scalars['ID']>,
  location?: Maybe<Location>,
  name?: Maybe<Scalars['String']>,
  status?: Maybe<Scalars['String']>,
  successful_launches?: Maybe<Scalars['Int']>,
  vehicles_launched?: Maybe<Array<Maybe<Rocket>>>,
  wikipedia?: Maybe<Scalars['String']>,
};

export type LaunchRocket = {
   __typename?: 'LaunchRocket',
  fairings?: Maybe<LaunchRocketFairings>,
  first_stage?: Maybe<LaunchRocketFirstStage>,
  rocket_name?: Maybe<Scalars['String']>,
  rocket_type?: Maybe<Scalars['String']>,
  rocket?: Maybe<Rocket>,
  second_stage?: Maybe<LaunchRocketSecondStage>,
};

export type LaunchRocketFairings = {
   __typename?: 'LaunchRocketFairings',
  recovered?: Maybe<Scalars['Boolean']>,
  recovery_attempt?: Maybe<Scalars['Boolean']>,
  reused?: Maybe<Scalars['Boolean']>,
  ship?: Maybe<Scalars['String']>,
};

export type LaunchRocketFirstStage = {
   __typename?: 'LaunchRocketFirstStage',
  cores?: Maybe<Array<Maybe<LaunchRocketFirstStageCore>>>,
};

export type LaunchRocketFirstStageCore = {
   __typename?: 'LaunchRocketFirstStageCore',
  block?: Maybe<Scalars['Int']>,
  core?: Maybe<Core>,
  flight?: Maybe<Scalars['Int']>,
  gridfins?: Maybe<Scalars['Boolean']>,
  land_success?: Maybe<Scalars['Boolean']>,
  landing_intent?: Maybe<Scalars['Boolean']>,
  landing_type?: Maybe<Scalars['String']>,
  landing_vehicle?: Maybe<Scalars['String']>,
  legs?: Maybe<Scalars['Boolean']>,
  reused?: Maybe<Scalars['Boolean']>,
};

export type LaunchRocketSecondStage = {
   __typename?: 'LaunchRocketSecondStage',
  block?: Maybe<Scalars['Int']>,
  payloads?: Maybe<Array<Maybe<Payload>>>,
};

export type LaunchSite = {
   __typename?: 'LaunchSite',
  site_id?: Maybe<Scalars['String']>,
  site_name_long?: Maybe<Scalars['String']>,
  site_name?: Maybe<Scalars['String']>,
};

export type LaunchTelemetry = {
   __typename?: 'LaunchTelemetry',
  flight_club?: Maybe<Scalars['String']>,
};

export type Link = {
   __typename?: 'Link',
  article?: Maybe<Scalars['String']>,
  reddit?: Maybe<Scalars['String']>,
  wikipedia?: Maybe<Scalars['String']>,
};

export type Location = {
   __typename?: 'Location',
  latitude?: Maybe<Scalars['Float']>,
  longitude?: Maybe<Scalars['Float']>,
  name?: Maybe<Scalars['String']>,
  region?: Maybe<Scalars['String']>,
};

export type Mass = {
   __typename?: 'Mass',
  kg?: Maybe<Scalars['Int']>,
  lb?: Maybe<Scalars['Int']>,
};

export type Mission = {
   __typename?: 'Mission',
  description?: Maybe<Scalars['String']>,
  id?: Maybe<Scalars['ID']>,
  manufacturers?: Maybe<Array<Maybe<Scalars['String']>>>,
  name?: Maybe<Scalars['String']>,
  twitter?: Maybe<Scalars['String']>,
  website?: Maybe<Scalars['String']>,
  wikipedia?: Maybe<Scalars['String']>,
  payloads?: Maybe<Array<Maybe<Payload>>>,
};

export type MissionResult = {
   __typename?: 'MissionResult',
  result?: Maybe<Result>,
  data?: Maybe<Array<Maybe<Mission>>>,
};

export type MissionsFind = {
  id?: Maybe<Scalars['ID']>,
  manufacturer?: Maybe<Scalars['String']>,
  name?: Maybe<Scalars['String']>,
  payload_id?: Maybe<Scalars['String']>,
};


export type Payload = {
   __typename?: 'Payload',
  customers?: Maybe<Array<Maybe<Scalars['String']>>>,
  id?: Maybe<Scalars['ID']>,
  manufacturer?: Maybe<Scalars['String']>,
  nationality?: Maybe<Scalars['String']>,
  norad_id?: Maybe<Array<Maybe<Scalars['Int']>>>,
  orbit_params?: Maybe<PayloadOrbitParams>,
  orbit?: Maybe<Scalars['String']>,
  payload_mass_kg?: Maybe<Scalars['Float']>,
  payload_mass_lbs?: Maybe<Scalars['Float']>,
  payload_type?: Maybe<Scalars['String']>,
  reused?: Maybe<Scalars['Boolean']>,
};

export type PayloadOrbitParams = {
   __typename?: 'PayloadOrbitParams',
  apoapsis_km?: Maybe<Scalars['Float']>,
  arg_of_pericenter?: Maybe<Scalars['Float']>,
  eccentricity?: Maybe<Scalars['Float']>,
  epoch?: Maybe<Scalars['Date']>,
  inclination_deg?: Maybe<Scalars['Float']>,
  lifespan_years?: Maybe<Scalars['Float']>,
  longitude?: Maybe<Scalars['Float']>,
  mean_anomaly?: Maybe<Scalars['Float']>,
  mean_motion?: Maybe<Scalars['Float']>,
  periapsis_km?: Maybe<Scalars['Float']>,
  period_min?: Maybe<Scalars['Float']>,
  raan?: Maybe<Scalars['Float']>,
  reference_system?: Maybe<Scalars['String']>,
  regime?: Maybe<Scalars['String']>,
  semi_major_axis_km?: Maybe<Scalars['Float']>,
};

export type PayloadsFind = {
  apoapsis_km?: Maybe<Scalars['Float']>,
  customer?: Maybe<Scalars['String']>,
  eccentricity?: Maybe<Scalars['Float']>,
  epoch?: Maybe<Scalars['Date']>,
  inclination_deg?: Maybe<Scalars['Float']>,
  lifespan_years?: Maybe<Scalars['Float']>,
  longitude?: Maybe<Scalars['Float']>,
  manufacturer?: Maybe<Scalars['String']>,
  mean_motion?: Maybe<Scalars['Float']>,
  nationality?: Maybe<Scalars['String']>,
  norad_id?: Maybe<Scalars['Int']>,
  orbit?: Maybe<Scalars['String']>,
  payload_id?: Maybe<Scalars['ID']>,
  payload_type?: Maybe<Scalars['String']>,
  periapsis_km?: Maybe<Scalars['Float']>,
  period_min?: Maybe<Scalars['Float']>,
  raan?: Maybe<Scalars['Float']>,
  reference_system?: Maybe<Scalars['String']>,
  regime?: Maybe<Scalars['String']>,
  reused?: Maybe<Scalars['Boolean']>,
  semi_major_axis_km?: Maybe<Scalars['Float']>,
};

export type Query = {
   __typename?: 'Query',
  capsules?: Maybe<Array<Maybe<Capsule>>>,
  capsulesPast?: Maybe<Array<Maybe<Capsule>>>,
  capsulesUpcoming?: Maybe<Array<Maybe<Capsule>>>,
  capsule?: Maybe<Capsule>,
  company?: Maybe<Info>,
  cores?: Maybe<Array<Maybe<Core>>>,
  coresPast?: Maybe<Array<Maybe<Core>>>,
  coresUpcoming?: Maybe<Array<Maybe<Core>>>,
  core?: Maybe<Core>,
  dragons?: Maybe<Array<Maybe<Dragon>>>,
  dragon?: Maybe<Dragon>,
  histories?: Maybe<Array<Maybe<History>>>,
  historiesResult?: Maybe<HistoriesResult>,
  history?: Maybe<History>,
  landpads?: Maybe<Array<Maybe<Landpad>>>,
  landpad?: Maybe<Landpad>,
  launches?: Maybe<Array<Maybe<Launch>>>,
  launchesPast?: Maybe<Array<Maybe<Launch>>>,
  launchesPastResult?: Maybe<LaunchesPastResult>,
  launchesUpcoming?: Maybe<Array<Maybe<Launch>>>,
  launch?: Maybe<Launch>,
  launchLatest?: Maybe<Launch>,
  launchNext?: Maybe<Launch>,
  launchpads?: Maybe<Array<Maybe<Launchpad>>>,
  launchpad?: Maybe<Launchpad>,
  missions?: Maybe<Array<Maybe<Mission>>>,
  missionsResult?: Maybe<MissionResult>,
  mission?: Maybe<Mission>,
  payloads?: Maybe<Array<Maybe<Payload>>>,
  payload?: Maybe<Payload>,
  roadster?: Maybe<Roadster>,
  rockets?: Maybe<Array<Maybe<Rocket>>>,
  rocketsResult?: Maybe<RocketsResult>,
  rocket?: Maybe<Rocket>,
  ships?: Maybe<Array<Maybe<Ship>>>,
  shipsResult?: Maybe<ShipsResult>,
  ship?: Maybe<Ship>,
};


export type QueryCapsulesArgs = {
  find?: Maybe<CapsulesFind>,
  limit?: Maybe<Scalars['Int']>,
  offset?: Maybe<Scalars['Int']>,
  order?: Maybe<Scalars['String']>,
  sort?: Maybe<Scalars['String']>
};


export type QueryCapsulesPastArgs = {
  find?: Maybe<CapsulesFind>,
  limit?: Maybe<Scalars['Int']>,
  offset?: Maybe<Scalars['Int']>,
  order?: Maybe<Scalars['String']>,
  sort?: Maybe<Scalars['String']>
};


export type QueryCapsulesUpcomingArgs = {
  find?: Maybe<CapsulesFind>,
  limit?: Maybe<Scalars['Int']>,
  offset?: Maybe<Scalars['Int']>,
  order?: Maybe<Scalars['String']>,
  sort?: Maybe<Scalars['String']>
};


export type QueryCapsuleArgs = {
  id: Scalars['ID']
};


export type QueryCoresArgs = {
  find?: Maybe<CoresFind>,
  limit?: Maybe<Scalars['Int']>,
  offset?: Maybe<Scalars['Int']>,
  order?: Maybe<Scalars['String']>,
  sort?: Maybe<Scalars['String']>
};


export type QueryCoresPastArgs = {
  find?: Maybe<CoresFind>,
  limit?: Maybe<Scalars['Int']>,
  offset?: Maybe<Scalars['Int']>,
  order?: Maybe<Scalars['String']>,
  sort?: Maybe<Scalars['String']>
};


export type QueryCoresUpcomingArgs = {
  find?: Maybe<CoresFind>,
  limit?: Maybe<Scalars['Int']>,
  offset?: Maybe<Scalars['Int']>,
  order?: Maybe<Scalars['String']>,
  sort?: Maybe<Scalars['String']>
};


export type QueryCoreArgs = {
  id: Scalars['ID']
};


export type QueryDragonsArgs = {
  limit?: Maybe<Scalars['Int']>,
  offset?: Maybe<Scalars['Int']>
};


export type QueryDragonArgs = {
  id: Scalars['ID']
};


export type QueryHistoriesArgs = {
  find?: Maybe<HistoryFind>,
  limit?: Maybe<Scalars['Int']>,
  offset?: Maybe<Scalars['Int']>,
  order?: Maybe<Scalars['String']>,
  sort?: Maybe<Scalars['String']>
};


export type QueryHistoriesResultArgs = {
  find?: Maybe<HistoryFind>,
  limit?: Maybe<Scalars['Int']>,
  offset?: Maybe<Scalars['Int']>,
  order?: Maybe<Scalars['String']>,
  sort?: Maybe<Scalars['String']>
};


export type QueryHistoryArgs = {
  id: Scalars['ID']
};


export type QueryLandpadsArgs = {
  limit?: Maybe<Scalars['Int']>,
  offset?: Maybe<Scalars['Int']>
};


export type QueryLandpadArgs = {
  id: Scalars['ID']
};


export type QueryLaunchesArgs = {
  find?: Maybe<LaunchFind>,
  limit?: Maybe<Scalars['Int']>,
  offset?: Maybe<Scalars['Int']>,
  order?: Maybe<Scalars['String']>,
  sort?: Maybe<Scalars['String']>
};


export type QueryLaunchesPastArgs = {
  find?: Maybe<LaunchFind>,
  limit?: Maybe<Scalars['Int']>,
  offset?: Maybe<Scalars['Int']>,
  order?: Maybe<Scalars['String']>,
  sort?: Maybe<Scalars['String']>
};


export type QueryLaunchesPastResultArgs = {
  find?: Maybe<LaunchFind>,
  limit?: Maybe<Scalars['Int']>,
  offset?: Maybe<Scalars['Int']>,
  order?: Maybe<Scalars['String']>,
  sort?: Maybe<Scalars['String']>
};


export type QueryLaunchesUpcomingArgs = {
  find?: Maybe<LaunchFind>,
  limit?: Maybe<Scalars['Int']>,
  offset?: Maybe<Scalars['Int']>,
  order?: Maybe<Scalars['String']>,
  sort?: Maybe<Scalars['String']>
};


export type QueryLaunchArgs = {
  id: Scalars['ID']
};


export type QueryLaunchLatestArgs = {
  offset?: Maybe<Scalars['Int']>
};


export type QueryLaunchNextArgs = {
  offset?: Maybe<Scalars['Int']>
};


export type QueryLaunchpadsArgs = {
  limit?: Maybe<Scalars['Int']>,
  offset?: Maybe<Scalars['Int']>
};


export type QueryLaunchpadArgs = {
  id: Scalars['ID']
};


export type QueryMissionsArgs = {
  find?: Maybe<MissionsFind>,
  limit?: Maybe<Scalars['Int']>,
  offset?: Maybe<Scalars['Int']>
};


export type QueryMissionsResultArgs = {
  find?: Maybe<MissionsFind>,
  limit?: Maybe<Scalars['Int']>,
  offset?: Maybe<Scalars['Int']>
};


export type QueryMissionArgs = {
  id: Scalars['ID']
};


export type QueryPayloadsArgs = {
  find?: Maybe<PayloadsFind>,
  limit?: Maybe<Scalars['Int']>,
  offset?: Maybe<Scalars['Int']>,
  order?: Maybe<Scalars['String']>,
  sort?: Maybe<Scalars['String']>
};


export type QueryPayloadArgs = {
  id: Scalars['ID']
};


export type QueryRocketsArgs = {
  limit?: Maybe<Scalars['Int']>,
  offset?: Maybe<Scalars['Int']>
};


export type QueryRocketsResultArgs = {
  limit?: Maybe<Scalars['Int']>,
  offset?: Maybe<Scalars['Int']>
};


export type QueryRocketArgs = {
  id: Scalars['ID']
};


export type QueryShipsArgs = {
  find?: Maybe<ShipsFind>,
  limit?: Maybe<Scalars['Int']>,
  offset?: Maybe<Scalars['Int']>,
  order?: Maybe<Scalars['String']>,
  sort?: Maybe<Scalars['String']>
};


export type QueryShipsResultArgs = {
  find?: Maybe<ShipsFind>,
  limit?: Maybe<Scalars['Int']>,
  offset?: Maybe<Scalars['Int']>,
  order?: Maybe<Scalars['String']>,
  sort?: Maybe<Scalars['String']>
};


export type QueryShipArgs = {
  id: Scalars['ID']
};

export type Result = {
   __typename?: 'Result',
  totalCount?: Maybe<Scalars['Int']>,
};

export type Roadster = {
   __typename?: 'Roadster',
  apoapsis_au?: Maybe<Scalars['Float']>,
  details?: Maybe<Scalars['String']>,
  earth_distance_km?: Maybe<Scalars['Float']>,
  earth_distance_mi?: Maybe<Scalars['Float']>,
  eccentricity?: Maybe<Scalars['Float']>,
  epoch_jd?: Maybe<Scalars['Float']>,
  inclination?: Maybe<Scalars['Float']>,
  launch_date_unix?: Maybe<Scalars['Date']>,
  launch_date_utc?: Maybe<Scalars['Date']>,
  launch_mass_kg?: Maybe<Scalars['Int']>,
  launch_mass_lbs?: Maybe<Scalars['Int']>,
  longitude?: Maybe<Scalars['Float']>,
  mars_distance_km?: Maybe<Scalars['Float']>,
  mars_distance_mi?: Maybe<Scalars['Float']>,
  name?: Maybe<Scalars['String']>,
  norad_id?: Maybe<Scalars['Int']>,
  orbit_type?: Maybe<Scalars['Float']>,
  periapsis_arg?: Maybe<Scalars['Float']>,
  periapsis_au?: Maybe<Scalars['Float']>,
  period_days?: Maybe<Scalars['Float']>,
  semi_major_axis_au?: Maybe<Scalars['Float']>,
  speed_kph?: Maybe<Scalars['Float']>,
  speed_mph?: Maybe<Scalars['Float']>,
  wikipedia?: Maybe<Scalars['String']>,
};

export type Rocket = {
   __typename?: 'Rocket',
  active?: Maybe<Scalars['Boolean']>,
  boosters?: Maybe<Scalars['Int']>,
  company?: Maybe<Scalars['String']>,
  cost_per_launch?: Maybe<Scalars['Int']>,
  country?: Maybe<Scalars['String']>,
  description?: Maybe<Scalars['String']>,
  diameter?: Maybe<Distance>,
  engines?: Maybe<RocketEngines>,
  first_flight?: Maybe<Scalars['Date']>,
  first_stage?: Maybe<RocketFirstStage>,
  height?: Maybe<Distance>,
  id?: Maybe<Scalars['ID']>,
  landing_legs?: Maybe<RocketLandingLegs>,
  mass?: Maybe<Mass>,
  name?: Maybe<Scalars['String']>,
  payload_weights?: Maybe<Array<Maybe<RocketPayloadWeight>>>,
  second_stage?: Maybe<RocketSecondStage>,
  stages?: Maybe<Scalars['Int']>,
  success_rate_pct?: Maybe<Scalars['Int']>,
  type?: Maybe<Scalars['String']>,
  wikipedia?: Maybe<Scalars['String']>,
};

export type RocketEngines = {
   __typename?: 'RocketEngines',
  number?: Maybe<Scalars['Int']>,
  type?: Maybe<Scalars['String']>,
  version?: Maybe<Scalars['String']>,
  layout?: Maybe<Scalars['String']>,
  engine_loss_max?: Maybe<Scalars['String']>,
  propellant_1?: Maybe<Scalars['String']>,
  propellant_2?: Maybe<Scalars['String']>,
  thrust_sea_level?: Maybe<Force>,
  thrust_vacuum?: Maybe<Force>,
  thrust_to_weight?: Maybe<Scalars['Float']>,
};

export type RocketFirstStage = {
   __typename?: 'RocketFirstStage',
  burn_time_sec?: Maybe<Scalars['Int']>,
  engines?: Maybe<Scalars['Int']>,
  fuel_amount_tons?: Maybe<Scalars['Float']>,
  reusable?: Maybe<Scalars['Boolean']>,
  thrust_sea_level?: Maybe<Force>,
  thrust_vacuum?: Maybe<Force>,
};

export type RocketLandingLegs = {
   __typename?: 'RocketLandingLegs',
  number?: Maybe<Scalars['Int']>,
  material?: Maybe<Scalars['String']>,
};

export type RocketPayloadWeight = {
   __typename?: 'RocketPayloadWeight',
  id?: Maybe<Scalars['String']>,
  kg?: Maybe<Scalars['Int']>,
  lb?: Maybe<Scalars['Int']>,
  name?: Maybe<Scalars['String']>,
};

export type RocketSecondStage = {
   __typename?: 'RocketSecondStage',
  burn_time_sec?: Maybe<Scalars['Int']>,
  engines?: Maybe<Scalars['Int']>,
  fuel_amount_tons?: Maybe<Scalars['Float']>,
  payloads?: Maybe<RocketSecondStagePayloads>,
  thrust?: Maybe<Force>,
};

export type RocketSecondStagePayloadCompositeFairing = {
   __typename?: 'RocketSecondStagePayloadCompositeFairing',
  height?: Maybe<Distance>,
  diameter?: Maybe<Distance>,
};

export type RocketSecondStagePayloads = {
   __typename?: 'RocketSecondStagePayloads',
  option_1?: Maybe<Scalars['String']>,
  composite_fairing?: Maybe<RocketSecondStagePayloadCompositeFairing>,
};

export type RocketsResult = {
   __typename?: 'RocketsResult',
  result?: Maybe<Result>,
  data?: Maybe<Array<Maybe<Rocket>>>,
};

export type Ship = {
   __typename?: 'Ship',
  abs?: Maybe<Scalars['Int']>,
  active?: Maybe<Scalars['Boolean']>,
  attempted_landings?: Maybe<Scalars['Int']>,
  class?: Maybe<Scalars['Int']>,
  course_deg?: Maybe<Scalars['Int']>,
  home_port?: Maybe<Scalars['String']>,
  id?: Maybe<Scalars['ID']>,
  image?: Maybe<Scalars['String']>,
  imo?: Maybe<Scalars['Int']>,
  missions?: Maybe<Array<Maybe<ShipMission>>>,
  mmsi?: Maybe<Scalars['Int']>,
  model?: Maybe<Scalars['String']>,
  name?: Maybe<Scalars['String']>,
  position?: Maybe<ShipLocation>,
  roles?: Maybe<Array<Maybe<Scalars['String']>>>,
  speed_kn?: Maybe<Scalars['Float']>,
  status?: Maybe<Scalars['String']>,
  successful_landings?: Maybe<Scalars['Int']>,
  type?: Maybe<Scalars['String']>,
  url?: Maybe<Scalars['String']>,
  weight_kg?: Maybe<Scalars['Int']>,
  weight_lbs?: Maybe<Scalars['Int']>,
  year_built?: Maybe<Scalars['Int']>,
};

export type ShipLocation = {
   __typename?: 'ShipLocation',
  latitude?: Maybe<Scalars['Float']>,
  longitude?: Maybe<Scalars['Float']>,
};

export type ShipMission = {
   __typename?: 'ShipMission',
  flight?: Maybe<Scalars['String']>,
  name?: Maybe<Scalars['String']>,
};

export type ShipsFind = {
  id?: Maybe<Scalars['ID']>,
  name?: Maybe<Scalars['String']>,
  model?: Maybe<Scalars['String']>,
  type?: Maybe<Scalars['String']>,
  role?: Maybe<Scalars['String']>,
  active?: Maybe<Scalars['Boolean']>,
  imo?: Maybe<Scalars['Int']>,
  mmsi?: Maybe<Scalars['Int']>,
  abs?: Maybe<Scalars['Int']>,
  class?: Maybe<Scalars['Int']>,
  weight_lbs?: Maybe<Scalars['Int']>,
  weight_kg?: Maybe<Scalars['Int']>,
  year_built?: Maybe<Scalars['Int']>,
  home_port?: Maybe<Scalars['String']>,
  status?: Maybe<Scalars['String']>,
  speed_kn?: Maybe<Scalars['Int']>,
  course_deg?: Maybe<Scalars['Int']>,
  latitude?: Maybe<Scalars['Float']>,
  longitude?: Maybe<Scalars['Float']>,
  successful_landings?: Maybe<Scalars['Int']>,
  attempted_landings?: Maybe<Scalars['Int']>,
  mission?: Maybe<Scalars['String']>,
};

export type ShipsResult = {
   __typename?: 'ShipsResult',
  result?: Maybe<Result>,
  data?: Maybe<Array<Maybe<Ship>>>,
};

export type Volume = {
   __typename?: 'Volume',
  cubic_feet?: Maybe<Scalars['Int']>,
  cubic_meters?: Maybe<Scalars['Int']>,
};
export type LaunchDetailsQueryVariables = {
  id: Scalars['ID']
};


export type LaunchDetailsQuery = (
  { __typename?: 'Query' }
  & { launch: Maybe<(
    { __typename?: 'Launch' }
    & Pick<Launch, 'id' | 'mission_name' | 'details'>
    & { links: Maybe<(
      { __typename?: 'LaunchLinks' }
      & Pick<LaunchLinks, 'flickr_images' | 'mission_patch'>
    )> }
  )> }
);

export type PastLaunchesListQueryVariables = {
  limit: Scalars['Int']
};


export type PastLaunchesListQuery = (
  { __typename?: 'Query' }
  & { launchesPast: Maybe<Array<Maybe<(
    { __typename?: 'Launch' }
    & Pick<Launch, 'id' | 'mission_name' | 'launch_date_utc'>
    & { links: Maybe<(
      { __typename?: 'LaunchLinks' }
      & Pick<LaunchLinks, 'flickr_images' | 'mission_patch_small'>
    )>, rocket: Maybe<(
      { __typename?: 'LaunchRocket' }
      & Pick<LaunchRocket, 'rocket_name'>
    )> }
  )>>> }
);

export const LaunchDetailsDocument = gql`
    query launchDetails($id: ID!) {
  launch(id: $id) {
    id
    mission_name
    details
    links {
      flickr_images
      mission_patch
    }
  }
}
    `;

  @Injectable({
    providedIn: 'root'
  })
  export class LaunchDetailsGQL extends Apollo.Query<LaunchDetailsQuery, LaunchDetailsQueryVariables> {
    document = LaunchDetailsDocument;
    
  }
export const PastLaunchesListDocument = gql`
    query pastLaunchesList($limit: Int!) {
  launchesPast(limit: $limit) {
    id
    mission_name
    links {
      flickr_images
      mission_patch_small
    }
    rocket {
      rocket_name
    }
    launch_date_utc
  }
}
    `;

  @Injectable({
    providedIn: 'root'
  })
  export class PastLaunchesListGQL extends Apollo.Query<PastLaunchesListQuery, PastLaunchesListQueryVariables> {
    document = PastLaunchesListDocument;
    
  }

================================================
FILE: src/assets/.gitkeep
================================================


================================================
FILE: src/environments/environment.prod.ts
================================================
export const environment = {
  production: true
};


================================================
FILE: src/environments/environment.ts
================================================
// This file can be replaced during build by using the `fileReplacements` array.
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.

export const environment = {
  production: false
};

/*
 * For easier debugging in development mode, you can import the following file
 * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
 *
 * This import should be commented out in production mode because it will have a negative impact
 * on performance if an error is thrown.
 */
// import 'zone.js/dist/zone-error';  // Included with Angular CLI.


================================================
FILE: src/index.html
================================================
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>AngularSpacexGraphqlCodegen</title>
  <base href="/">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="favicon.ico">
  <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500&display=swap" rel="stylesheet">
  <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
</head>
<body>
  <app-root></app-root>
</body>
</html>


================================================
FILE: src/main.ts
================================================
import 'hammerjs';
import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';

import { AppModule } from './app/app.module';
import { environment } from './environments/environment';

if (environment.production) {
  enableProdMode();
}

platformBrowserDynamic().bootstrapModule(AppModule)
  .catch(err => console.error(err));


================================================
FILE: src/polyfills.ts
================================================
/**
 * This file includes polyfills needed by Angular and is loaded before the app.
 * You can add your own extra polyfills to this file.
 *
 * This file is divided into 2 sections:
 *   1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers.
 *   2. Application imports. Files imported after ZoneJS that should be loaded before your main
 *      file.
 *
 * The current setup is for so-called "evergreen" browsers; the last versions of browsers that
 * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera),
 * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile.
 *
 * Learn more in https://angular.io/guide/browser-support
 */

/***************************************************************************************************
 * BROWSER POLYFILLS
 */

/** IE10 and IE11 requires the following for NgClass support on SVG elements */
// import 'classlist.js';  // Run `npm install --save classlist.js`.

/**
 * Web Animations `@angular/platform-browser/animations`
 * Only required if AnimationBuilder is used within the application and using IE/Edge or Safari.
 * Standard animation support in Angular DOES NOT require any polyfills (as of Angular 6.0).
 */
// import 'web-animations-js';  // Run `npm install --save web-animations-js`.

/**
 * By default, zone.js will patch all possible macroTask and DomEvents
 * user can disable parts of macroTask/DomEvents patch by setting following flags
 * because those flags need to be set before `zone.js` being loaded, and webpack
 * will put import in the top of bundle, so user need to create a separate file
 * in this directory (for example: zone-flags.ts), and put the following flags
 * into that file, and then add the following code before importing zone.js.
 * import './zone-flags.ts';
 *
 * The flags allowed in zone-flags.ts are listed here.
 *
 * The following flags will work for all browsers.
 *
 * (window as any).__Zone_disable_requestAnimationFrame = true; // disable patch requestAnimationFrame
 * (window as any).__Zone_disable_on_property = true; // disable patch onProperty such as onclick
 * (window as any).__zone_symbol__UNPATCHED_EVENTS = ['scroll', 'mousemove']; // disable patch specified eventNames
 *
 *  in IE/Edge developer tools, the addEventListener will also be wrapped by zone.js
 *  with the following flag, it will bypass `zone.js` patch for IE/Edge
 *
 *  (window as any).__Zone_enable_cross_context_check = true;
 *
 */

/***************************************************************************************************
 * Zone JS is required by default for Angular itself.
 */
import 'zone.js/dist/zone';  // Included with Angular CLI.


/***************************************************************************************************
 * APPLICATION IMPORTS
 */


================================================
FILE: src/styles.css
================================================
/* You can add global styles to this file, and also import other style files */

html, body { height: 100%; }
body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; }


================================================
FILE: src/test.ts
================================================
// This file is required by karma.conf.js and loads recursively all the .spec and framework files

import 'zone.js/dist/zone-testing';
import { getTestBed } from '@angular/core/testing';
import {
  BrowserDynamicTestingModule,
  platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';

declare const require: any;

// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
  BrowserDynamicTestingModule,
  platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);


================================================
FILE: tsconfig.app.json
================================================
{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "outDir": "./out-tsc/app",
    "types": []
  },
  "files": [
    "src/main.ts",
    "src/polyfills.ts"
  ],
  "include": [
    "src/**/*.ts"
  ],
  "exclude": [
    "src/test.ts",
    "src/**/*.spec.ts"
  ]
}


================================================
FILE: tsconfig.json
================================================
{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "module": "esnext",
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es2015",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2018",
      "dom",
      "esnext.asynciterable"
    ]
  },
  "angularCompilerOptions": {
    "fullTemplateTypeCheck": true,
    "strictInjectionParameters": true
  }
}

================================================
FILE: tsconfig.spec.json
================================================
{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "outDir": "./out-tsc/spec",
    "types": [
      "jasmine",
      "node"
    ]
  },
  "files": [
    "src/test.ts",
    "src/polyfills.ts"
  ],
  "include": [
    "src/**/*.spec.ts",
    "src/**/*.d.ts"
  ]
}


================================================
FILE: tslint.json
================================================
{
  "extends": "tslint:recommended",
  "rules": {
    "array-type": false,
    "arrow-parens": false,
    "deprecation": {
      "severity": "warning"
    },
    "component-class-suffix": true,
    "contextual-lifecycle": true,
    "directive-class-suffix": true,
    "directive-selector": [
      true,
      "attribute",
      "app",
      "camelCase"
    ],
    "component-selector": [
      true,
      "element",
      "app",
      "kebab-case"
    ],
    "import-blacklist": [
      true,
      "rxjs/Rx"
    ],
    "interface-name": false,
    "max-classes-per-file": false,
    "max-line-length": [
      true,
      140
    ],
    "member-access": false,
    "member-ordering": [
      true,
      {
        "order": [
          "static-field",
          "instance-field",
          "static-method",
          "instance-method"
        ]
      }
    ],
    "no-consecutive-blank-lines": false,
    "no-console": [
      true,
      "debug",
      "info",
      "time",
      "timeEnd",
      "trace"
    ],
    "no-empty": false,
    "no-inferrable-types": [
      true,
      "ignore-params"
    ],
    "no-non-null-assertion": true,
    "no-redundant-jsdoc": true,
    "no-switch-case-fall-through": true,
    "no-use-before-declare": true,
    "no-var-requires": false,
    "object-literal-key-quotes": [
      true,
      "as-needed"
    ],
    "object-literal-sort-keys": false,
    "ordered-imports": false,
    "quotemark": [
      true,
      "single"
    ],
    "trailing-comma": false,
    "no-conflicting-lifecycle": true,
    "no-host-metadata-property": true,
    "no-input-rename": true,
    "no-inputs-metadata-property": true,
    "no-output-native": true,
    "no-output-on-prefix": true,
    "no-output-rename": true,
    "no-outputs-metadata-property": true,
    "template-banana-in-box": true,
    "template-no-negated-async": true,
    "use-lifecycle-interface": true,
    "use-pipe-transform-interface": true
  },
  "rulesDirectory": [
    "codelyzer"
  ]
}
Download .txt
gitextract_i8_mwi3q/

├── .editorconfig
├── .gitignore
├── LICENSE
├── README.md
├── angular.json
├── apollo.config.js
├── browserslist
├── codegen.yml
├── e2e/
│   ├── protractor.conf.js
│   ├── src/
│   │   ├── app.e2e-spec.ts
│   │   └── app.po.ts
│   └── tsconfig.json
├── karma.conf.js
├── package.json
├── src/
│   ├── app/
│   │   ├── app-routing.module.ts
│   │   ├── app.component.css
│   │   ├── app.component.html
│   │   ├── app.component.spec.ts
│   │   ├── app.component.ts
│   │   ├── app.module.ts
│   │   ├── graphql.module.ts
│   │   ├── launch-details/
│   │   │   ├── launch-details.component.css
│   │   │   ├── launch-details.component.html
│   │   │   ├── launch-details.component.spec.ts
│   │   │   ├── launch-details.component.ts
│   │   │   └── launch-details.graphql
│   │   ├── launch-list/
│   │   │   ├── launch-list.component.css
│   │   │   ├── launch-list.component.html
│   │   │   ├── launch-list.component.spec.ts
│   │   │   ├── launch-list.component.ts
│   │   │   └── launch-list.graphql
│   │   ├── relative-time/
│   │   │   ├── relative-time.pipe.spec.ts
│   │   │   └── relative-time.pipe.ts
│   │   └── services/
│   │       └── spacexGraphql.service.ts
│   ├── assets/
│   │   └── .gitkeep
│   ├── environments/
│   │   ├── environment.prod.ts
│   │   └── environment.ts
│   ├── index.html
│   ├── main.ts
│   ├── polyfills.ts
│   ├── styles.css
│   └── test.ts
├── tsconfig.app.json
├── tsconfig.json
├── tsconfig.spec.json
└── tslint.json
Download .txt
SYMBOL INDEX (118 symbols across 10 files)

FILE: e2e/protractor.conf.js
  method onPrepare (line 26) | onPrepare() {

FILE: e2e/src/app.po.ts
  class AppPage (line 3) | class AppPage {
    method navigateTo (line 4) | navigateTo() {
    method getTitleText (line 8) | getTitleText() {

FILE: src/app/app-routing.module.ts
  class AppRoutingModule (line 21) | class AppRoutingModule {}

FILE: src/app/app.component.ts
  class AppComponent (line 8) | class AppComponent {

FILE: src/app/app.module.ts
  class AppModule (line 27) | class AppModule {}

FILE: src/app/graphql.module.ts
  function createApollo (line 7) | function createApollo(httpLink: HttpLink) {
  class GraphQLModule (line 24) | class GraphQLModule {}

FILE: src/app/launch-details/launch-details.component.ts
  class LaunchDetailsComponent (line 12) | class LaunchDetailsComponent {
    method constructor (line 13) | constructor(

FILE: src/app/launch-list/launch-list.component.ts
  class LaunchListComponent (line 11) | class LaunchListComponent {
    method constructor (line 12) | constructor(private readonly pastLaunchesService: PastLaunchesListGQL) {}

FILE: src/app/relative-time/relative-time.pipe.ts
  class RelativeTimePipe (line 11) | class RelativeTimePipe implements PipeTransform {
    method transform (line 12) | transform(utcTime: string): string {

FILE: src/app/services/spacexGraphql.service.ts
  type Maybe (line 4) | type Maybe<T> = T | null;
  type Scalars (line 6) | type Scalars = {
  type Address (line 19) | type Address = {
  type Capsule (line 26) | type Capsule = {
  type CapsuleMission (line 38) | type CapsuleMission = {
  type CapsulesFind (line 44) | type CapsulesFind = {
  type Core (line 54) | type Core = {
  type CoreMission (line 69) | type CoreMission = {
  type CoresFind (line 75) | type CoresFind = {
  type Distance (line 90) | type Distance = {
  type Dragon (line 96) | type Dragon = {
  type DragonHeatShield (line 122) | type DragonHeatShield = {
  type DragonPressurizedCapsule (line 130) | type DragonPressurizedCapsule = {
  type DragonThrust (line 135) | type DragonThrust = {
  type DragonTrunk (line 145) | type DragonTrunk = {
  type DragonTrunkCargo (line 151) | type DragonTrunkCargo = {
  type Force (line 157) | type Force = {
  type HistoriesResult (line 163) | type HistoriesResult = {
  type History (line 169) | type History = {
  type HistoryFind (line 180) | type HistoryFind = {
  type Info (line 187) | type Info = {
  type InfoLinks (line 206) | type InfoLinks = {
  type Landpad (line 214) | type Landpad = {
  type Launch (line 227) | type Launch = {
  type LaunchesPastResult (line 250) | type LaunchesPastResult = {
  type LaunchFind (line 256) | type LaunchFind = {
  type LaunchLinks (line 319) | type LaunchLinks = {
  type Launchpad (line 334) | type Launchpad = {
  type LaunchRocket (line 347) | type LaunchRocket = {
  type LaunchRocketFairings (line 357) | type LaunchRocketFairings = {
  type LaunchRocketFirstStage (line 365) | type LaunchRocketFirstStage = {
  type LaunchRocketFirstStageCore (line 370) | type LaunchRocketFirstStageCore = {
  type LaunchRocketSecondStage (line 384) | type LaunchRocketSecondStage = {
  type LaunchSite (line 390) | type LaunchSite = {
  type LaunchTelemetry (line 397) | type LaunchTelemetry = {
  type Link (line 402) | type Link = {
  type Location (line 409) | type Location = {
  type Mass (line 417) | type Mass = {
  type Mission (line 423) | type Mission = {
  type MissionResult (line 435) | type MissionResult = {
  type MissionsFind (line 441) | type MissionsFind = {
  type Payload (line 449) | type Payload = {
  type PayloadOrbitParams (line 464) | type PayloadOrbitParams = {
  type PayloadsFind (line 483) | type PayloadsFind = {
  type Query (line 507) | type Query = {
  type QueryCapsulesArgs (line 549) | type QueryCapsulesArgs = {
  type QueryCapsulesPastArgs (line 558) | type QueryCapsulesPastArgs = {
  type QueryCapsulesUpcomingArgs (line 567) | type QueryCapsulesUpcomingArgs = {
  type QueryCapsuleArgs (line 576) | type QueryCapsuleArgs = {
  type QueryCoresArgs (line 581) | type QueryCoresArgs = {
  type QueryCoresPastArgs (line 590) | type QueryCoresPastArgs = {
  type QueryCoresUpcomingArgs (line 599) | type QueryCoresUpcomingArgs = {
  type QueryCoreArgs (line 608) | type QueryCoreArgs = {
  type QueryDragonsArgs (line 613) | type QueryDragonsArgs = {
  type QueryDragonArgs (line 619) | type QueryDragonArgs = {
  type QueryHistoriesArgs (line 624) | type QueryHistoriesArgs = {
  type QueryHistoriesResultArgs (line 633) | type QueryHistoriesResultArgs = {
  type QueryHistoryArgs (line 642) | type QueryHistoryArgs = {
  type QueryLandpadsArgs (line 647) | type QueryLandpadsArgs = {
  type QueryLandpadArgs (line 653) | type QueryLandpadArgs = {
  type QueryLaunchesArgs (line 658) | type QueryLaunchesArgs = {
  type QueryLaunchesPastArgs (line 667) | type QueryLaunchesPastArgs = {
  type QueryLaunchesPastResultArgs (line 676) | type QueryLaunchesPastResultArgs = {
  type QueryLaunchesUpcomingArgs (line 685) | type QueryLaunchesUpcomingArgs = {
  type QueryLaunchArgs (line 694) | type QueryLaunchArgs = {
  type QueryLaunchLatestArgs (line 699) | type QueryLaunchLatestArgs = {
  type QueryLaunchNextArgs (line 704) | type QueryLaunchNextArgs = {
  type QueryLaunchpadsArgs (line 709) | type QueryLaunchpadsArgs = {
  type QueryLaunchpadArgs (line 715) | type QueryLaunchpadArgs = {
  type QueryMissionsArgs (line 720) | type QueryMissionsArgs = {
  type QueryMissionsResultArgs (line 727) | type QueryMissionsResultArgs = {
  type QueryMissionArgs (line 734) | type QueryMissionArgs = {
  type QueryPayloadsArgs (line 739) | type QueryPayloadsArgs = {
  type QueryPayloadArgs (line 748) | type QueryPayloadArgs = {
  type QueryRocketsArgs (line 753) | type QueryRocketsArgs = {
  type QueryRocketsResultArgs (line 759) | type QueryRocketsResultArgs = {
  type QueryRocketArgs (line 765) | type QueryRocketArgs = {
  type QueryShipsArgs (line 770) | type QueryShipsArgs = {
  type QueryShipsResultArgs (line 779) | type QueryShipsResultArgs = {
  type QueryShipArgs (line 788) | type QueryShipArgs = {
  type Result (line 792) | type Result = {
  type Roadster (line 797) | type Roadster = {
  type Rocket (line 825) | type Rocket = {
  type RocketEngines (line 850) | type RocketEngines = {
  type RocketFirstStage (line 864) | type RocketFirstStage = {
  type RocketLandingLegs (line 874) | type RocketLandingLegs = {
  type RocketPayloadWeight (line 880) | type RocketPayloadWeight = {
  type RocketSecondStage (line 888) | type RocketSecondStage = {
  type RocketSecondStagePayloadCompositeFairing (line 897) | type RocketSecondStagePayloadCompositeFairing = {
  type RocketSecondStagePayloads (line 903) | type RocketSecondStagePayloads = {
  type RocketsResult (line 909) | type RocketsResult = {
  type Ship (line 915) | type Ship = {
  type ShipLocation (line 942) | type ShipLocation = {
  type ShipMission (line 948) | type ShipMission = {
  type ShipsFind (line 954) | type ShipsFind = {
  type ShipsResult (line 979) | type ShipsResult = {
  type Volume (line 985) | type Volume = {
  type LaunchDetailsQueryVariables (line 990) | type LaunchDetailsQueryVariables = {
  type LaunchDetailsQuery (line 995) | type LaunchDetailsQuery = (
  type PastLaunchesListQueryVariables (line 1007) | type PastLaunchesListQueryVariables = {
  type PastLaunchesListQuery (line 1012) | type PastLaunchesListQuery = (
  class LaunchDetailsGQL (line 1044) | class LaunchDetailsGQL extends Apollo.Query<LaunchDetailsQuery, LaunchDe...
  class PastLaunchesListGQL (line 1068) | class PastLaunchesListGQL extends Apollo.Query<PastLaunchesListQuery, Pa...
Condensed preview — 46 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (76K chars).
[
  {
    "path": ".editorconfig",
    "chars": 246,
    "preview": "# Editor configuration, see https://editorconfig.org\nroot = true\n\n[*]\ncharset = utf-8\nindent_style = space\nindent_size ="
  },
  {
    "path": ".gitignore",
    "chars": 631,
    "preview": "# See http://help.github.com/ignore-files/ for more about ignoring files.\n\n# compiled output\n/dist\n/tmp\n/out-tsc\n# Only "
  },
  {
    "path": "LICENSE",
    "chars": 1210,
    "preview": "This is free and unencumbered software released into the public domain.\n\nAnyone is free to copy, modify, publish, use, c"
  },
  {
    "path": "README.md",
    "chars": 9953,
    "preview": "# Angular Spacex Graphql Codegen\n\n## Mission\n\nOur goal is to make an Angular app with a list of the past SpaceX launches"
  },
  {
    "path": "angular.json",
    "chars": 3952,
    "preview": "{\n  \"$schema\": \"./node_modules/@angular/cli/lib/config/schema.json\",\n  \"version\": 1,\n  \"newProjectRoot\": \"projects\",\n  \""
  },
  {
    "path": "apollo.config.js",
    "chars": 151,
    "preview": "module.exports = {\n  client: {\n    service: {\n      name: 'angular-spacex-graphql-codegen',\n      url: 'https://api.spac"
  },
  {
    "path": "browserslist",
    "chars": 429,
    "preview": "# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.\n# For addit"
  },
  {
    "path": "codegen.yml",
    "chars": 361,
    "preview": "# Where to get schema data\nschema:\n  - https://api.spacex.land/graphql/\n# The client side queries to turn into services\n"
  },
  {
    "path": "e2e/protractor.conf.js",
    "chars": 810,
    "preview": "// @ts-check\n// Protractor configuration file, see link for more information\n// https://github.com/angular/protractor/bl"
  },
  {
    "path": "e2e/src/app.e2e-spec.ts",
    "chars": 663,
    "preview": "import { AppPage } from './app.po';\nimport { browser, logging } from 'protractor';\n\ndescribe('workspace-project App', ()"
  },
  {
    "path": "e2e/src/app.po.ts",
    "chars": 262,
    "preview": "import { browser, by, element } from 'protractor';\n\nexport class AppPage {\n  navigateTo() {\n    return browser.get(brows"
  },
  {
    "path": "e2e/tsconfig.json",
    "chars": 214,
    "preview": "{\n  \"extends\": \"../tsconfig.json\",\n  \"compilerOptions\": {\n    \"outDir\": \"../out-tsc/e2e\",\n    \"module\": \"commonjs\",\n    "
  },
  {
    "path": "karma.conf.js",
    "chars": 1042,
    "preview": "// Karma configuration file, see link for more information\n// https://karma-runner.github.io/1.0/config/configuration-fi"
  },
  {
    "path": "package.json",
    "chars": 1856,
    "preview": "{\n  \"name\": \"angular-spacex-graphql-codegen\",\n  \"version\": \"0.0.0\",\n  \"scripts\": {\n    \"ng\": \"ng\",\n    \"start\": \"ng serv"
  },
  {
    "path": "src/app/app-routing.module.ts",
    "chars": 525,
    "preview": "import { NgModule } from '@angular/core';\nimport { Routes, RouterModule } from '@angular/router';\nimport { LaunchListCom"
  },
  {
    "path": "src/app/app.component.css",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "src/app/app.component.html",
    "chars": 32,
    "preview": "<router-outlet></router-outlet>\n"
  },
  {
    "path": "src/app/app.component.spec.ts",
    "chars": 1170,
    "preview": "import { TestBed, async } from '@angular/core/testing';\nimport { RouterTestingModule } from '@angular/router/testing';\ni"
  },
  {
    "path": "src/app/app.component.ts",
    "chars": 255,
    "preview": "import { Component } from '@angular/core';\n\n@Component({\n  selector: 'app-root',\n  templateUrl: './app.component.html',\n"
  },
  {
    "path": "src/app/app.module.ts",
    "chars": 1009,
    "preview": "import { BrowserModule } from '@angular/platform-browser';\nimport { NgModule } from '@angular/core';\n\nimport { AppRoutin"
  },
  {
    "path": "src/app/graphql.module.ts",
    "chars": 660,
    "preview": "import {NgModule} from '@angular/core';\nimport {ApolloModule, APOLLO_OPTIONS} from 'apollo-angular';\nimport {HttpLinkMod"
  },
  {
    "path": "src/app/launch-details/launch-details.component.css",
    "chars": 150,
    "preview": ".photo-grid {\n  padding-top: 30px;\n  display: grid;\n  grid-gap: 10px;\n  grid-template-columns: repeat(auto-fill, 300px);"
  },
  {
    "path": "src/app/launch-details/launch-details.component.html",
    "chars": 865,
    "preview": "<ng-container *ngIf=\"launchDetails$ | async as launchDetails\">\n  <section style=\"padding-top: 20px;\">\n    <mat-card styl"
  },
  {
    "path": "src/app/launch-details/launch-details.component.spec.ts",
    "chars": 678,
    "preview": "import { async, ComponentFixture, TestBed } from '@angular/core/testing';\n\nimport { LaunchDetailsComponent } from './lau"
  },
  {
    "path": "src/app/launch-details/launch-details.component.ts",
    "chars": 801,
    "preview": "import { Component, ChangeDetectionStrategy } from '@angular/core';\nimport { ActivatedRoute } from '@angular/router';\nim"
  },
  {
    "path": "src/app/launch-details/launch-details.graphql",
    "chars": 210,
    "preview": "# src/app/launch-details/launch-details.frontend.graphql\n\nquery launchDetails($id: ID!) {\n  launch(id: $id) {\n    id\n   "
  },
  {
    "path": "src/app/launch-list/launch-list.component.css",
    "chars": 183,
    "preview": ".container {\n  padding-top: 20px;\n  display: grid;\n  grid-gap: 30px;\n  grid-template-columns: repeat(auto-fill, 350px);\n"
  },
  {
    "path": "src/app/launch-list/launch-list.component.html",
    "chars": 1025,
    "preview": "<ng-container *ngIf=\"pastLaunches$ | async as pastLaunches\">\n  <main>\n    <section class=\"container\">\n      <mat-card\n  "
  },
  {
    "path": "src/app/launch-list/launch-list.component.spec.ts",
    "chars": 657,
    "preview": "import { async, ComponentFixture, TestBed } from '@angular/core/testing';\n\nimport { LaunchListComponent } from './launch"
  },
  {
    "path": "src/app/launch-list/launch-list.component.ts",
    "chars": 705,
    "preview": "import { Component, ChangeDetectionStrategy } from '@angular/core';\nimport { map } from 'rxjs/operators';\nimport { PastL"
  },
  {
    "path": "src/app/launch-list/launch-list.graphql",
    "chars": 265,
    "preview": "# src/app/launch-list/launch-list.graphql\n\nquery pastLaunchesList($limit: Int!) {\n  launchesPast(limit: $limit) {\n    id"
  },
  {
    "path": "src/app/relative-time/relative-time.pipe.spec.ts",
    "chars": 212,
    "preview": "import { RelativeTimePipe } from './relative-time.pipe';\n\ndescribe('RelativeTimePipe', () => {\n  it('create an instance'"
  },
  {
    "path": "src/app/relative-time/relative-time.pipe.ts",
    "chars": 561,
    "preview": "import { Pipe, PipeTransform } from '@angular/core';\n\nconst milliSecondsInDay = 1000 * 3600 * 24;\n\n// Cast as any becaus"
  },
  {
    "path": "src/app/services/spacexGraphql.service.ts",
    "chars": 29757,
    "preview": "import gql from 'graphql-tag';\nimport { Injectable } from '@angular/core';\nimport * as Apollo from 'apollo-angular';\nexp"
  },
  {
    "path": "src/assets/.gitkeep",
    "chars": 0,
    "preview": ""
  },
  {
    "path": "src/environments/environment.prod.ts",
    "chars": 51,
    "preview": "export const environment = {\n  production: true\n};\n"
  },
  {
    "path": "src/environments/environment.ts",
    "chars": 662,
    "preview": "// This file can be replaced during build by using the `fileReplacements` array.\n// `ng build --prod` replaces `environm"
  },
  {
    "path": "src/index.html",
    "chars": 507,
    "preview": "<!doctype html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"utf-8\">\n  <title>AngularSpacexGraphqlCodegen</title>\n  <base hr"
  },
  {
    "path": "src/main.ts",
    "chars": 391,
    "preview": "import 'hammerjs';\nimport { enableProdMode } from '@angular/core';\nimport { platformBrowserDynamic } from '@angular/plat"
  },
  {
    "path": "src/polyfills.ts",
    "chars": 2838,
    "preview": "/**\n * This file includes polyfills needed by Angular and is loaded before the app.\n * You can add your own extra polyfi"
  },
  {
    "path": "src/styles.css",
    "chars": 181,
    "preview": "/* You can add global styles to this file, and also import other style files */\n\nhtml, body { height: 100%; }\nbody { mar"
  },
  {
    "path": "src/test.ts",
    "chars": 642,
    "preview": "// This file is required by karma.conf.js and loads recursively all the .spec and framework files\n\nimport 'zone.js/dist/"
  },
  {
    "path": "tsconfig.app.json",
    "chars": 270,
    "preview": "{\n  \"extends\": \"./tsconfig.json\",\n  \"compilerOptions\": {\n    \"outDir\": \"./out-tsc/app\",\n    \"types\": []\n  },\n  \"files\": "
  },
  {
    "path": "tsconfig.json",
    "chars": 572,
    "preview": "{\n  \"compileOnSave\": false,\n  \"compilerOptions\": {\n    \"baseUrl\": \"./\",\n    \"outDir\": \"./dist/out-tsc\",\n    \"sourceMap\":"
  },
  {
    "path": "tsconfig.spec.json",
    "chars": 270,
    "preview": "{\n  \"extends\": \"./tsconfig.json\",\n  \"compilerOptions\": {\n    \"outDir\": \"./out-tsc/spec\",\n    \"types\": [\n      \"jasmine\","
  },
  {
    "path": "tslint.json",
    "chars": 1988,
    "preview": "{\n  \"extends\": \"tslint:recommended\",\n  \"rules\": {\n    \"array-type\": false,\n    \"arrow-parens\": false,\n    \"deprecation\":"
  }
]

About this extraction

This page contains the full source code of the arjunyel/angular-spacex-graphql-codegen GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 46 files (68.2 KB), approximately 18.6k tokens, and a symbol index with 118 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!