Skip to content

BlackWaspTech/the-buzz

Repository files navigation

The Buzz

Take a look at a live, full-stack application showcasing wasp-graphql.

The Buzz is a social media application that uses both wasp-graphql and redux-wasp

For an additional feature unique to Redux while using GraphQL with Apollo Client v2.0, check out redux-wasp-apollo

Showcasing Wasp-Graphql

First things first, require Wasp-GraphQL:

import { query } from 'wasp-graphql';

One of our example strings:

let findUser = `query findUser($username: String!){
  user(userName: $username) {
    id
    username
    biography
    password
    address
  }
}`;

We set up our endpoint and init:

const API = 'http://localhost:8080/graphql';

const init = {
  body: JSON.stringify({
    query: queries.findUser,
    variables: vars
  })
};

Then used Wasp-GraphQL:

query(API, init)
  .then(res => {
    return res.json();
  })
  .then(resp => {
    store.dispatch(types.updateUser(resp));
  });

Showcasing Redux-wasp

We incorporated wasp-graphql into redux-wasp

componentDidMount() {
  if (this.props.cookies.cookies.loggedIn) {
    const vars = {
      username: this.props.cookies.cookies.loggedIn
    };
  const init = {
    body: JSON.stringify({
      query: queries.findUser,
      variables: vars
    })
  };

  query(API, init)
    .then(res => {
      return res.json();
    })
    .then(resp => {
      store.dispatch(types.updateUser(resp));
    });
  }
}

Changelog

View it here

Contributing

Read more

Contributors

Thanks goes to these wonderful people (emoji key):


Denny Temple


Reynolds A Colon


kamo31


marceca

This project follows the all-contributors specification. Contributions of any kind welcome!

Code of Conduct

Read our Code of Conduct here.

License

Free and Open Source under the MIT License.

About

Cutting-edge social media application using Wasp-graphQL and Redux-Wasp

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published