How to use the apollo-angular.Subscription 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 Urigo / WhatsApp-Clone-Client-Angular / src / graphql.ts View on Github external
AddMessage.Variables
> {
  document: any = gql`
    mutation AddMessage($chatId: ID!, $content: String!) {
      addMessage(chatId: $chatId, content: $content) {
        ...Message
      }
    }

    ${MessageFragment}
  `;
}
@Injectable({
  providedIn: "root"
})
export class ChatAddedGQL extends Apollo.Subscription<
  ChatAdded.Subscription,
  ChatAdded.Variables
> {
  document: any = gql`
    subscription chatAdded {
      chatAdded {
        ...ChatWithoutMessages
        messages {
          ...Message
        }
      }
    }

    ${ChatWithoutMessagesFragment}
    ${MessageFragment}
  `;
github Urigo / WhatsApp-Clone-Client-Angular / src / graphql.ts View on Github external
GetUsers.Variables
> {
  document: any = gql`
    query GetUsers {
      users {
        id
        name
        picture
      }
    }
  `;
}
@Injectable({
  providedIn: "root"
})
export class MessageAddedGQL extends Apollo.Subscription<
  MessageAdded.Subscription,
  MessageAdded.Variables
> {
  document: any = gql`
    subscription messageAdded {
      messageAdded {
        ...Message
        chat {
          id
        }
      }
    }

    ${MessageFragment}
  `;
}

apollo-angular

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

MIT
Latest version published 1 month ago

Package Health Score

92 / 100
Full package analysis