All Projects → peterpme → Apollo Tote

peterpme / Apollo Tote

👜 A declarative approach to handling Apollo GraphQL queries in React

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Apollo Tote

Blaze Apollo
Blaze integration for the Apollo Client
Stars: ✭ 56 (-26.32%)
Mutual labels:  graphql, apollo
Nextjs Strapi Boilerplate
🎨 Boilerplate for building applications using Strapi and Next.js
Stars: ✭ 76 (+0%)
Mutual labels:  graphql, apollo
Erxes Api
API for erxes
Stars: ✭ 57 (-25%)
Mutual labels:  graphql, apollo
A Pop
🎶 HD Music Streaming and Sharing Web App
Stars: ✭ 55 (-27.63%)
Mutual labels:  graphql, apollo
Apollo Upload Client
A terminating Apollo Link for Apollo Client that allows FileList, File, Blob or ReactNativeFile instances within query or mutation variables and sends GraphQL multipart requests.
Stars: ✭ 1,176 (+1447.37%)
Mutual labels:  graphql, apollo
Apollo Cache Persist
🎏 Simple persistence for all Apollo Cache implementations
Stars: ✭ 1,078 (+1318.42%)
Mutual labels:  graphql, apollo
Guide To Graphql
A Frontend Developer's Guide to GraphQL (Fluent Conf 2018)
Stars: ✭ 59 (-22.37%)
Mutual labels:  graphql, apollo
Graphql Modules
⚠️ [DEPRECATED] GraphQL module library for Apollo.
Stars: ✭ 53 (-30.26%)
Mutual labels:  graphql, apollo
React Hipstaplate
A ReactJS full-stack boilerplate based on typescript with ssr, custom apollo-server and huge stack of modern utilities which will help you to start your own project
Stars: ✭ 74 (-2.63%)
Mutual labels:  graphql, apollo
Cynthesize Frontend
Frontend written in Angular 7 and deployed GraphQL for Cynthesize. Development build: https://cynthesize-develop.netlify.com
Stars: ✭ 65 (-14.47%)
Mutual labels:  graphql, apollo
Apollo Invalidation Policies
An extension of the Apollo 3 cache with support for type-based invalidation policies.
Stars: ✭ 55 (-27.63%)
Mutual labels:  graphql, apollo
Apollo Server Vercel
⚫ Production-ready Node.js GraphQL server for Vercel Serverless Functions
Stars: ✭ 69 (-9.21%)
Mutual labels:  graphql, apollo
Laravel Vuejs.com
Laravel and VueJs Blog, using Laravel nova, GraphQL, NuxtJs, Apollo and ...more
Stars: ✭ 54 (-28.95%)
Mutual labels:  graphql, apollo
Subscriptions Transport Sse
A Server-Side-Events (SSE) client + server for GraphQL subscriptions
Stars: ✭ 55 (-27.63%)
Mutual labels:  graphql, apollo
Graphql Upload
Middleware and an Upload scalar to add support for GraphQL multipart requests (file uploads via queries and mutations) to various Node.js GraphQL servers.
Stars: ✭ 1,071 (+1309.21%)
Mutual labels:  graphql, apollo
Next React Graphql Apollo boostrap
React + GraphQL + Next.js project architecture that I play with right now
Stars: ✭ 59 (-22.37%)
Mutual labels:  graphql, apollo
Graphql Advanced Projection
Fully customizable Mongoose/MongoDB projection generator.
Stars: ✭ 46 (-39.47%)
Mutual labels:  graphql, apollo
Apollo Redux Form
Redux forms powered by Apollo
Stars: ✭ 52 (-31.58%)
Mutual labels:  graphql, apollo
Apollo Link Sentry
Apollo Link middleware which enriches SentryJS with GraphQL data
Stars: ✭ 63 (-17.11%)
Mutual labels:  graphql, apollo
Artemis Dev Tool
An Apollo GraphQL Query Schema Testing Tool
Stars: ✭ 66 (-13.16%)
Mutual labels:  graphql, apollo

apollo-tote

👜 A declarative approach to handling Apollo queries in React

npm version

Installation

yarn add apollo-tote

or

npm install --save apollo-tote

Usage Examples

  • Fetch current user query. If an api token exists but is no longer valid (ie: cleared database), log user out.
<ApolloTote
    query={`
      query {
        user {
          id
        }
      }
    `}
    test={data => !!(data && data.user && data.user.id)}
    handleFail={() => Store.dispatch({ type: 'LOG_OUT' })}
    handlePass={() => Store.dispatch({ type: 'LOG_IN' })}
    renderError={error => this._renderError(error)}
    renderLoading={() => <App.Loading />}
    render={() => <App />}
/>
  • Render loading component until data comes back.
<ApolloTote
    query={`
      query {
        user {
          imageUrl
        }
      }
    `}
    renderLoading={() => <Avatar.Loading />}
    render={value => <Avatar imageUrl={value.user.imageUrl} />}
/>

PropTypes

  • skip: Boolean - Should we skip over query and just render?
  • query: String - Your graphql query
  • variables: String - Graphql query variables
  • test: Function (Optional) - helper to handle a successful query's response
  • handlePass: Function (Optional) - a function to render a successful test
  • handleFail: Function (Optional) - a function to render a failed test
  • renderError: Function - error function
  • renderLoading: Function - loading function
  • render: Function - a function that renders the result of your query
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].