How to use the apollo-angular.Query function in apollo-angular

To help you get started, we’ve selected a few apollo-angular examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github notadd / ng-notadd / src / app / graphql / graphql.service.ts View on Github external
export class MdiIconsGQL extends Apollo.Query<
    MdiIcons.Query,
    MdiIcons.Variables
> {
    document: any = gql`
        query mdiIcons {
            mdiIcons {
                name
            }
        }
    `;
}
@Injectable({
    providedIn: "root"
})
export class WidgetsGQL extends Apollo.Query {
    document: any = gql`
        query widgets {
            widgets {
                type
                chartData {
                    date
                    amount
                }
                increase
                currentAmount
            }
        }
    `;
}

// ====================================================
github kamilkisiela / apollo-angular-services / src / app / generated / graphql.ts View on Github external
export const AuthorFragmentFragment = gql`
  fragment AuthorFragment on Author {
    id
    firstName
    lastName
  }
`;

// ====================================================
// Apollo Services
// ====================================================

@Injectable({
  providedIn: "root"
})
export class AllPostsGQL extends Apollo.Query<
  AllPosts.Query,
  AllPosts.Variables
> {
  document: any = gql`
    query AllPosts {
      posts {
        id
        title
        votes
        author {
          ...AuthorFragment
        }
      }
    }

    ${AuthorFragmentFragment}
github visual-knight / platform-community-edition / apps / visual-knight / src / app / modules / core / types.ts View on Github external
export class DeclineTestSessionGQL extends Apollo.Mutation<
  DeclineTestSessionMutation,
  DeclineTestSessionMutationVariables
> {
  document = DeclineTestSessionDocument;
}
export const SelectedTestSessionDocument = gql`
  query selectedTestSession {
    selectedTestSession @client
  }
`;

@Injectable({
  providedIn: 'root'
})
export class SelectedTestSessionGQL extends Apollo.Query<
  SelectedTestSessionQuery,
  SelectedTestSessionQueryVariables
> {
  document = SelectedTestSessionDocument;
}
export const GetTestNameDocument = gql`
  query getTestName($testId: String!) {
    test(testId: $testId) {
      name
    }
  }
`;

@Injectable({
  providedIn: 'root'
})
github visual-knight / platform-community-edition / apps / visual-knight / src / app / modules / core / types.ts View on Github external
> {
  document = UserlistDocument;
}
export const GetVariationDocument = gql`
  query getVariation($variationId: String!) {
    variation(variationId: $variationId) {
      ...VariationData
    }
  }
  ${VariationDataFragmentDoc}
`;

@Injectable({
  providedIn: 'root'
})
export class GetVariationGQL extends Apollo.Query<
  GetVariationQuery,
  GetVariationQueryVariables
> {
  document = GetVariationDocument;
}
export const AllVariationsDocument = gql`
  query allVariations($testId: String!) {
    variations(testId: $testId) {
      ...VariationData
    }
  }
  ${VariationDataFragmentDoc}
`;

@Injectable({
  providedIn: 'root'
github ardatan / graphql-modules-accountsjs-boilerplate / angular-client / src / generated-models.ts View on Github external
mutation AddPost($title: String, $content: String) {
      addPost(title: $title, content: $content) {
        id
        title
        content
        author {
          username
        }
      }
    }
  `;
}
@Injectable({
  providedIn: "root"
})
export class AllPostsGQL extends Apollo.Query<
  AllPosts.Query,
  AllPosts.Variables
> {
  document: any = gql`
    query AllPosts {
      allPosts {
        id
        title
        content
        author {
          username
        }
      }
    }
  `;
}

apollo-angular

Use your GraphQL data in your Angular app, with the Apollo Client

MIT
Latest version published 3 days ago

Package Health Score

92 / 100
Full package analysis