Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
}
}
`;
}
// ====================================================
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}
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'
})
> {
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'
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
}
}
}
`;
}