Skip to content

leveluptuts/comboquery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GraphQL Combo Query

Combine Your GraphQL Queries

Inspired by: apollographql/graphql-tag#169 (comment)

Usage

npm install @leveluptuts/comboquery

// Import your queries OR write them separately with gql``
import SINGLE_POST_QUERY from './graphql/SinglePost.graphql';
import USER_QUERY from './graphql/UserQuery.graphql';

const SomeComponent = () => {
  const { slug } = useParams();
  const COMBO_QUERY = comboQuery([SINGLE_POST_QUERY, USER_QUERY]);

  // This example is using Apollo React Hooks
  const { loading, data, error } = useQuery(COMBO_QUERY, {
    variables: { slug },
  });

  // ... the rest of your stuffs
  return ();

};

Level Up Tutorials

https://www.leveluptutorials.com

Cutting-edge, focused & high quality video tutorials for web developers and designers

Syntax

https://syntax.fm/

A Tasty Treats Podcast for Web Developers.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published