We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Note that members of a union type need to be concrete object types; you can't create a union type out of interfaces or other unions.
Proposal: Support union scalar types
useQuery
useLazyQuery
useMutation
The package graphql-tag comes with a loader easy to setup and with some benefits:
Do not process GraphQL ASTs on client-side
Enable queries to be separated from logic
babel-plugin-graphql-tag
graphql-tag.macro
babel-plugin-import-graphql
useSubscription
useApolloClient
Apollo Graph Manager (formerly Apollo Engine) is a cloud service that helps you manage, validate, and secure your organization's data graph.
apollo-link-http
apollo-link-state
apollo-link-rest
apollo-link-error
apollo-link-context
apollo-link-retry
apollo-link-ws
apollo-link-batch-http
apollo-link-dedup
apollo-link-schema
AppSync is a managed service that uses GraphQL to make it easy for applications to get exactly the data they need.
The API category provides a GraphQL client for working with queries, mutations, and subscriptions. This client does not support offline programming.
The following documentation outlines how to use the Apollo client with AWS AppSync and important client APIs to understand.
This SDK can be used with the Apollo JavaScript client
Note that we alias apollo-client to point to @apollo/client here because aws-appsync-subscription-link has a peerDependency on "apollo-client": "2.x":
apollo-client
@apollo/client
aws-appsync-subscription-link
"apollo-client": "2.x"
package.json
{ "dependencies": { "@apollo/client": "^3.0.0-beta.41", "apollo-client": "npm:@apollo/client@^3.0.0-beta.41", "aws-amplify": "1.1.31-preview.111", "aws-appsync-auth-link": "^2.0.1", "aws-appsync-subscription-link": "^2.0.1", "graphql": "^15.0.0", "graphql-tag": "^2.10.3", "react": "^16.12.0", "react-dom": "^16.12.0" } }
import React from 'react' import ReactDOM from 'react-dom' import { Auth, Hub } from 'aws-amplify' import { ApolloProvider, ApolloClient, ApolloLink, InMemoryCache, } from '@apollo/client' import { createAuthLink } from 'aws-appsync-auth-link' import { createSubscriptionHandshakeLink } from 'aws-appsync-subscription-link' // https://aws-amplify.github.io/docs/js/hub Hub.listen(/.*/, ({ channel, payload }) => console.debug(`[hub::${channel}::${payload.event}]`, payload) ) // https://aws-amplify.github.io/docs/js/authentication#manual-setup Auth.configure({ region: process.env.REACT_APP_AUTH_REGION, userPoolId: process.env.REACT_APP_AUTH_USER_POOL_ID, userPoolWebClientId: process.env.REACT_APP_AUTH_USER_POOL_CLIENT_ID, // Cognito Hosted UI configuration oauth: { domain: process.env.REACT_APP_AUTH_DOMAIN, scope: ['email', 'profile', 'openid'], redirectSignIn: document.location.origin, redirectSignOut: document.location.origin, responseType: 'code', }, }) const getAccessToken = async () => Auth.currentSession().then(session => session.getAccessToken().getJwtToken()) const url = process.env.REACT_APP_APPSYNC_URL const region = process.env.REACT_APP_APPSYNC_REGION const loggedInAuth = { type: 'AMAZON_COGNITO_USER_POOLS', jwtToken: getAccessToken, } const anonymousAuth = { type: 'API_KEY', apiKey: process.env.REACT_APP_APPSYNC_API_KEY, } const searchParams = new URLSearchParams(window.location.search) const isClient = searchParams.has('client') const auth = isClient ? loggedInAuth : anonymousAuth // https://github.com/awslabs/aws-mobile-appsync-sdk-js#using-authorization-and-subscription-links-with-apollo-client-no-offline-support const link = ApolloLink.from([ createAuthLink({ url, region, auth }), createSubscriptionHandshakeLink({ url, region, auth }), ]) const apolloClient = new ApolloClient({ link, cache: new InMemoryCache(), }) ReactDOM.render( <ApolloProvider client={apolloClient}> <App /> </ApolloProvider>, document.getElementById('root') )
Create GraphQL schema and resolvers with TypeScript, using classes and decorators!
Validation made easy using TypeScript decorators.
The database built for serverless, featuring native GraphQL
The text was updated successfully, but these errors were encountered:
No branches or pull requests
GraphQL
Apollo GraphQL
useQuery
useLazyQuery
useMutation
babel-plugin-graphql-tag
graphql-tag.macro
babel-plugin-import-graphql
useQuery
,useLazyQuery
,useMutation
,useSubscription
,useApolloClient
apollo-link-http
,apollo-link-state
,apollo-link-rest
,apollo-link-error
,apollo-link-context
,apollo-link-retry
,apollo-link-ws
,apollo-link-batch-http
,apollo-link-dedup
,apollo-link-schema
AWS AppSync
Example: React + Apollo + AppSync
Note that we alias
apollo-client
to point to@apollo/client
here becauseaws-appsync-subscription-link
has a peerDependency on"apollo-client": "2.x"
:package.json
Type GraphQL (TypeScript)
Fauna
Unsorted
See Also
The text was updated successfully, but these errors were encountered: