If you want to build apps with React and GraphQL, Apollo is the library you should use.
- You can easily find the NDB codes 2020 using simple internet search with the name of casino you prefer or you can check out top casino bonus codes with no deposit on our website. Only trustful casinos with relevant bonus codes are waiting for you to use them.
- Free no deposit casino bonus code for Grande Vegas Casino Use bonus code: WED284321-FREE $100 Free chip Maximum CashOut – $250. If your last transaction.
I've put together a comprehensive cheatsheet that goes through all of the core concepts in the Apollo library, showing you how to use it with React from front to back.
NDB Bonus Codes Best NDB Codes, NDB Casino Codes, NDB Codes Online Casinos, Latest NDB Codes, RTG NDB Codes & US NDB Codes. Decades ago, Brick & Mortar Casinos provided visitors with hotel upgrades and alcoholic drinks to sway them over into the various betting lounges. Popularity rose again throughout the 1st Quarter of 2020, with COVID-19.
Want Your Own Copy? ?
You can grab the PDF cheatsheet right here (it takes 5 seconds).
Here are some quick wins from grabbing the downloadable version:
- ✓ Quick reference to review however and whenever
- ✓ Tons of useful code snippets based off of real-world projects
- ✓ Read this guide offline, wherever you like. On the train, at your desk, standing in line — anywhere.
Prefer Video Lessons? ?
A great deal of this cheatsheet is based off of the app built in the React + GraphQL 2020 Crash Course.
If you want some more hands-on video lessons, plus see how to build apps with React, GraphQL and Apollo, you can watch the course right here.
Note: This cheatsheet does assume familiarity with React and GraphQL. If you need a quick refresher on GraphQL and how to write it, a great resource is the official GraphQL website.
Table of Contents
Getting Started
Core Apollo React Hooks
Essential Recipes
What is Apollo and why do we need it?
Apollo is a library that brings together two incredibly useful technologies used to build web and mobile apps: React and GraphQL.
React was made for creating great user experiences with JavaScript. GraphQL is a very straightforward and declarative new language to more easily and efficiently fetch and change data, whether it is from a database or even from static files.
Apollo is the glue that binds these two tools together. Plus it makes working with React and GraphQL a lot easier by giving us a lot of custom React hooks and features that enable us to both write GraphQL operations and execute them with JavaScript code.
We'll cover these features in-depth throughout the course of this guide.
Apollo Client basic setup
If you are starting a project with a React template like Create React App, you will need to install the following as your base dependencies to get up and running with Apollo Client:
@apollo/react-hooks gives us React hooks that make performing our operations and working with Apollo client better
apollo-boost helps us set up the client along with parse our GraphQL operations
graphql also takes care of parsing the GraphQL operations (along with gql)
Apollo Client + subscriptions setup
To use all manner of GraphQL operations (queries, mutations, and subscriptions), we need to install more specific dependencies as compared to just apollo-boost:
apollo-client gives us the client directly, instead of from apollo-boost
graphql-tag is integrated into apollo-boost, but not included in apollo-client
Apollo Ndb Codes 2020 Free
apollo-cache-inmemory is needed to setup our own cache (which apollo-boost, in comparison, does automatically)
apollo-link-ws is needed for communicating over websockets, which subscriptions require
Creating a new Apollo Client (basic setup)
The most straightforward setup for creating an Apollo client is by instantiating a new client and providing just the uri property, which will be your GraphQL endpoint:
apollo-boost was developed in order to make doing things like creating an Apollo Client as easy as possible. What it lacks for the time being, however, is support for GraphQL subscriptions over a websocket connection.
By default, it performs the operations over an http connection (as you can see through our provided uri above).
In short, use apollo-boost to create your client if you only need to execute queries and mutations in your app.
It setups an in-memory cache by default, which is helpful for storing our app data locally. We can read from and write to our cache to prevent having to execute our queries after our data is updated. We'll cover how to do that a bit later.
Creating a new Apollo Client (+ subscriptions setup)
Subscriptions are useful for more easily displaying the result of data changes (through mutations) in our app.
Generally speaking, we use subscriptions as an improved kind of query. Subscriptions use a websocket connection to 'subscribe' to updates and data, enabling new or updated data to be immediately displayed to our users without having to reexecute queries or update the cache.
Providing the client to React components
After creating a new client, passing it to all components is essential in order to be able to use it within our components to perform all of the available GraphQL operations.
The client is provided to the entire component tree using React Context, but instead of creating our own context, we import a special context provider from @apollo/react-hooks called ApolloProvider . We can see how it differs from the regular React Context due to it having a special prop, client, specifically made to accept the created client.
Note that all of this setup should be done in your index.js or App.js file (wherever your Routes declared) so that the Provider can be wrapped around all of your components.
Using the client directly
The Apollo client is most important part of the library due to the fact that it is responsible for executing all of the GraphQL operations that we want to perform with React.
We can use the created client directly to perform any operation we like. It has methods corresponding to queries (client.query()), mutations (client.mutate()), and subscriptions (client.subscribe()).
Each method accepts an object and it's own corresponding properties:
Using the client directly can be a bit tricky, however, since in making a request, it returns a promise. To resolve each promise, we either need .then() and .catch() callbacks as above or to await each promise within a function declared with the async keyword.
Writing GraphQL operations in .js files (gql)
Notice above that I didn't specify the contents of the variables GET_POSTS, CREATE_POST, and GET_POST.
They are the operations written in the GraphQL syntax which specify how to perform the query, mutation, and subscription respectively. They are what we would write in any GraphiQL console to get and change data.
The issue here, however, is that we can't write and execute GraphQL instructions in JavaScript (.js) files, like our React code has to live in.
To parse the GraphQL operations, we use a special function called a tagged template literal to allow us to express them as JavaScript strings. This function is named gql.
useQuery Hook
The useQuery hook is arguably the most convenient way of performing a GraphQL query, considering that it doesn't return a promise that needs to be resolved.
Apollo Ndb Codes 2020 List
It is called at the top of any function component (as all hooks should be) and receives as a first required argument—a query parsed with gql.
It is best used when you have queries that should be executed immediately, when a component is rendered, such as a list of data which the user would want to see immediately when the page loads.
useQuery returns an object from which we can easily destructure the values that we need. Upon executing a query, there are three primary values will need to use within every component in which we fetch data. They are loading, error, and data.
Before we can display the data that we're fetching, we need to handle when we're loading (when loading is set to true) and we are attempting to fetch the data.
At that point, we display a div with the text 'Loading' or a loading spinner. We also need to handle the possibility that there is an error in fetching our query, such as if there's a network error or if we made a mistake in writing our query (syntax error).
Once we're done loading and there's no error, we can use our data in our component, usually to display to our users (as we are in the example above).
There are other values which we can destructure from the object that useQuery returns, but you'll need loading, error, and data in virtually every component where you execute useQuery. You can see a full list of all of the data we can get back from useQuery here.
useLazyQuery Hook
The useLazyQuery hook provides another way to perform a query, which is intended to be executed at some time after the component is rendered or in response to a given data change.
useLazyQuery is very useful for things that happen at any unknown point of time, such as in response to a user's search operation.
useLazyQuery differs from useQuery, first of all, in what's returned from the hook. It returns an array which we can destructure, instead of an object.
Since we want to perform this query sometime after the component is mounted, the first element that we can destructure is a function which you can call to perform that query when you choose. This query function is named searchPosts in the example above.
The second destructured value in the array is an object, which we can use object destructuring on and from which we can get all of the same
properties as we did from useQuery, such as loading, error, and data.
We also get an important property named called,
which tells us if we've actually called this function to perform our query.
In that case, if called is true and loading is true, we want to
return 'Loading...' instead of our actual data, because are waiting for the data to be returned. This is how useLazyQuery handles fetching data in a synchronous way without any promises.
Note that we again pass any required variables for the query operation as a property, variables, to the second argument. However, if we need, we can pass those variables on an object provided to the query function itself.
useMutation Hook
Now that we know how to execute lazy queries, we know exactly how to work with the useMutation hook.

Like the useLazyQuery hook, it returns an array which we can destructure into its two elements. In the first element, we get back a function, which in this case, we can call it to perform our mutation operation. For next element, we can again destructure an object which returns to us loading, error and data.
Unlike with queries, however, we don't use loading or error in order to conditionally render something. We generally use loading in such situations as when we're submitting a form to prevent it being submitted multiple times, to avoid executing the same mutation needlessly (as you can see in the example above).
We use error to display what goes wrong with our mutation to our users. If for example, some required values to our mutation are not provided, we can easily use that error data to conditionally render an error message within the page so the user can hopefully fix what's going wrong.
As compared to passing variables to the second argument of useMutation, we can access a couple of useful callbacks when certain things take place, such as when the mutation is completed and when there is an error. These callbacks are named onCompleted and onError.
The onCompleted callback gives us access to the returned mutation data and it's very helpful to do something when the mutation is done, such as going to a different page. The onError callback gives us the returned error when there is a problem with the mutation and gives us other patterns for handling our errors.
useSubscription Hook
The useSubscription hook works just like the useQuery hook.
useSubscription returns an object that we can destructure, that includes the same properties, loading, data, and error.
It executes our subscription immediately when the component is rendered. This means we need to handle loading and error states, and only afterwards display/use our data.
Just like useQuery, useLazyQuery and useMutation, useSubscription accepts variables as a property provided on the second argument.
It also accepts, however, some useful properties such as shouldResubscribe. This is a boolean value, which will allow our subscription to automatically resubscribe, when our props change. This is useful for when we're passing variables to our you subscription hub props that we know will change.
Additionally, we have a callback function called onSubscriptionData, which enables us to call a function whenever the subscription hook receives new data. Finally, we can set the fetchPolicy, which defaults to 'cache-first'.
Manually Setting the Fetch Policy
What can be very useful about Apollo is that it comes with its own cache, which it uses to manage the data that we query from our GraphQL endpoint.
Sometimes, however, we find that due to this cache, things aren't updated in the UI in the way that we want.
In many cases we don't, as in the example below, where we are editing a post on the edit page, and then after editing our post, we navigate to the home page to see it in a list of all posts, but we see the old data instead:
This not only due to the Apollo cache, but also the instructions for what data the query should fetch. We can changed how the query is fetched by using the fetchPolicy property.
By default, the fetchPolicy is set to 'cache-first'. It's going to try to look at the cache to get our data instead of getting it from the network.
An easy way to fix this problem of not seeing new data is to change the fetch policy. However, this approach is not ideal from a performance standpoint, because it requires making an additional request (using the cache directly does not, because it is local data).
There are many different options for the fetch policy listed below:
I won't go into what each policy does exactly, but to solve our immediate problem, if you always want a query to get the latest data by requesting it from the network, we set fetchPolicy to 'network-first'.
Updating the cache upon a mutation
Instead of bypassing the cache by changing the fetch policy of useQuery, let's attempt to fix this problem by manually updating the cache.
When performing a mutation with useMutation. We have access to another callback, known as update.
update gives us direct access to the cache as well as the data that is returned from a successful mutation. This enables us to read a given query from the cache, take that new data and write the new data to the query, which will then update what the user sees.
Working with the cache manually is a tricky process that a lot of people tend to avoid, but it's very helpful because it saves some time and resources by not having to perform the same request multiple times to update the cache manually.
We first want to read the query and get the previous data from it. Then we need to take the new data. In this case, to find the post with a given id and replace it with newPost data, otherwise have it be the previous data, and then write that data back to the same query, making sure that it has the same data structure as before.
After all this, whenever we edit a post and are navigated back to the home page, we should see that new post data.
Refetching queries with useQuery
Let's say we display a list of posts using a GET_POSTS query and are deleting one of them with a DELETE_POST mutation.
When a user deletes a post, what do we want to happen?
Naturally, we want it to be removed from the list, both the data and what is displayed to the users. When a mutation is performed, however, the query doesn't know that the data is changed.
There are a few ways of updating what we see, but one approach is to reexecute the query.
We can do so by grabbing the refetch function which we can destructure from the object returned by the useQuery hook and pass it down to the mutation to be executed when it is completed, using the onCompleted callback function:
Refetching Queries with useMutation
Note that we can also utilize the useMutation hook to reexecute our queries through an argument provided to the mutate function, called refetchQueries.
It accepts an array of queries that we want to refetch after a mutation is performed. Each queries is provided within an object, just like we would provide it to client.query(), and consists of a query property and a variables property.
Here is a minimal example to refetch our GET_POSTS query after a new post is created:
Using the client with useApolloClient

We can get access to the client across our components with the help of a special hook called use Apollo client. This execute the hook at the top of our function component and we get back the client itself.
And from there we can execute all the same queries, mutations, and subscriptions.
Note that there are a ton more features that come with methods that come with the client. Using the client, we can also write and read data to and from the cache that Apollo sets up (using client.readData() and client.writeData()).
Working with the Apollo cache deserves its own crash course in itself. A great benefit of working with Apollo is that we can also use it as a state management system to replace solutions like Redux for our global state. If you want to learn more about using Apollo to manage global app state you can check out the following link.
I attempted to make this cheatsheet as comprehensive as possible, though it still leaves out many Apollo features that are worth investigating.
If you want to more about Apollo, be sure to check out the official Apollo documentation.
Download the cheatsheet ?
Want a quick reference of all of these concepts?
Click to grab the complete PDF cheatsheet
Apollo Slots Casino Exclusive No Deposit Bonus
Get R250, for free
- Use code: APNDKINGS
- Wagering requirements: 60x
- Maximum cashout: 2x bonus amount
Please note: Although this no deposit bonus may not be visible on the casino’s website, it will be credited to your account if you visit the cashier and enter the bonus code.
Other Apollo Slots Casino Bonus Codes and Promotions
Welcome Bonus – Up To R9999
- The welcome bonus package of up to R9999 is available on the first three deposits.
- The first deposit offers a 100% bonus up to R2999 using the coupon APL100.
- The second deposit offers an 80% bonus up to R4000 using the coupon APL80.
- The third deposit offers a 60% bonus up to R3000 using the coupon APL60.
- The wagering requirement is 30x the total of the deposit and the bonus.
- Wagering on Blackjack, Video Poker, Roulette, Pontoon, Bingo, Craps, War, Sic-Bo, and Baccarat will not contribute towards meeting wagering requirements.
- You have to deposit at least R50 each time in order to claim the bonuses.
Aphrodite’s Weekly Welcome
- This deposit bonus package is available to Apollo Slots Casino players every Monday.
- 80% match bonus on the first deposit up to R1000 using coupon Aphrodite80.
- 70% match bonus on the second deposit up to R700 using coupon Aphrodite70.
- 60% match bonus on the third deposit up to R500 using coupon Aphrodite60.
- The minimum deposit for reload bonuses is R50.
- The wagering requirement is 30x the deposit and bonus amount.
- Wagering on Roulette, Craps, Baccarat, Pontoon and War will not contribute for wagering requirements.
- Wagering Blackjack and Video Poker will contribute only 50% for wagering requirements.
Treasure of the Titans
- This high roller bonus package is available every Tuesday on the first three deposits.
- 70% match bonus on the first deposit up to R2000 using coupon Titans70.
- 60% match bonus on the second deposit up to R2000 using coupon Titans60.
- 50% match bonus on the third deposit up to R2000 using coupon Titans50.
- The minimum deposit for reload bonuses is R50.
- The wagering requirement is 30x the deposit and bonus amount.
- Wagering on Roulette, Craps, Baccarat, Pontoon and War will not contribute for wagering requirements.
- Wagering Blackjack and Video Poker will contribute only 50% for wagering requirements.
Weekly Promotions
- The weekly promotional bonuses are delivered directly to players’ email inbox.
- The offers also include competitions and slots tournaments.
- Register your correct email address at Apollo Slots to get the promotion offers.
About Apollo Slots Casino
As the name suggests, Apollo Slots Casino is about slots machines. There are different varieties of slot machines with different number of reels, different gaming features and different themes. All South African players will find a fair number of slot games to their liking. But Apollo Slots also offers the complete range of casino games for players with other preferences.
It is important to state that Apollo Slots Casino is licensed and regulated by the Kahnawake Gaming Commission. This implies that you will have all player protection practices in place. The software is regularly tested for fairness by Technical Systems Testing. The banking transactions and the casino server are completely safeguarded against unauthorised interception by the latest SSL encryption. Your withdrawal requests will be processed as stipulated.

Apollo Slots Instant Play and Download Casino Games Overview
The desktop platform at Apollo Slots Casino offers both download and instant play options. The download option is much older and compatible only with PCs. But it includes the complete portfolio of Realtime Gaming titles. The instant play software platform works on both PCs and Macs. It is reliable and secure and offers smooth gameplay. Though some of the very old Realtime Gaming titles are not available on the instant play platform, it is the preferred option for South African players.
Whichever option you select, you will first need to sign up and open a real money account.
- Click on “Create a New Account” link.
- Fill in the online registration form
- Accept the terms and conditions
- Submit the form.
Please read the terms and conditions before accepting. After you complete the verification procedure you can log in. Make a deposit and start playing with real money. You can also play the games in the free play mode, but then you cannot withdraw the winnings.
If you are playing in the download platform, you have to load the app and select the game from the games lobby. In the instant play platform, the games can be activated from the web site. Apollo Slots makes it convenient for players to locate games. If you are aware of the title then using the search engine is recommended. You will find that the new games are featured separately. Finally, the games are arranged and listed under common categories. The strength of the portfolio is as follows:
- Table Games: 18+ titles
- Slots: 180+ titles
- Video Poker: 75+ titles
- Specialty: 25+ titles
Realtime Online Casino Games at Apollo Slots Casino
Realtime Gaming is the only games supplier to Apollo Slots Casino. But players will not be strapped for choice. Also the quality of the games, particularly the video slots, matches the best in the industry.
Realtime Gaming has been well-known for decades for its Real Series slots. You will find the entire collection at Apollo Slots Casino. These video slots have randomly triggered progressive jackpots that hit very frequently without rising to big amounts.
If you like the ancient Greek theme of the online casino then you can try Achilles and Caesar’s Empire. If the South African adventure is your fancy then White Rhino is a fabulous choice. As such, every conceivable theme is covered.
At Apollo Slots you will get slots featuring some famous personalities. There are a number of branded slots featuring Asian movie star Jackie Chan. The Three Stooges appear in a couple of slot machines filled with their comic antics. Music lovers of old can head for Richie Valens and The Big Bopper.
The table games category covers casino poker games and online blackjack.
The video poker games are listed separately as single hand and multi-hand games.
Specialty Games are those not covered elsewhere and include roulette, craps, keno and scratch cards.
Apollo Slots Mobile Casino – Compatible with iOS and Android Devices
Apollo Slots Casino is also available on a mobile gaming platform for South African players on the move. It can be accessed from all the common smartphones and tablets in the South African market. The platform is not only compatible with iOS and Android operating systems, but also with the slightly less common ones like Windows and Blackberry. Both Safari and Chrome browsers work well with Apollo Slots mobile.
HTML5 Games at Apollo Slots Mobile Casino
The mobile gaming software is written in HTML5, which is the preferred option today. The games adapt to the different screen sizes of the various smartphones and tablets. So there is no distortion in the display. The Apollo Slots mobile casino operates in the instant play format. The games can be played in the browser of the mobile device. You do not have to download any native app.
You get exactly the same gaming experience on Apollo Slots mobile. The game portfolio is the same; you can claim the same bonuses and can carry out deposits and withdrawals in a secure environment. There are two easy options for accessing the Apollo Slots web site on your mobile device. You can use the browser search engine or you can scan the QR code displayed at the desktop casino from your smartphone or tablet.
How to Get Started at Apollo Slots Mobile Casino
Once you have accessed the Apollo Slots mobile casino web site, you should follow the steps given below.
- If you already are a member of the Apollo Slots desktop casino then you can log in at the mobile casino using the same user ID and password.
- If you do not have an account, then you can create a new one from the mobile device.
- To do this, you have to fill the registration form and complete the verification process.
- You can use your desktop casino balance or load your account from your mobile device.
- From the game lobby select the game you want to play.
- The game will open in your browser and you can start playing for fun or real money.
Apollo Slots VIP Program
Apollo Slots online casino does not offer any VIP program as of now. But it awards loyalty through a Comp points scheme. You will be awarded Comp points when you play games for real money at the online casino.
- For every R2 that you wager, you will get 1 Comp point. Comp points can then be redeemed for bonus credits.
- For every 500 comp points you will get a free bonus of R1.
The Comp points can be redeemed at the Apollo Slots Cashier from the My Account tab. The credits obtained from redeeming Comp points are free bonus and are subject to terms and conditions related to free bonuses.
Progressive Jackpots at Apollo Slots Casino
The randomly triggered progressive jackpots in the Real Series slots do not attract the serous progressive players. They are low variance games in which the progressive jackpots do not rise to life changing levels. Apollo Slots also offers some games with high payout progressive jackpots. If you want to try and win big then you can go for these games.
Apollo Ndb Codes 2020 May
The more popular are the progressive jackpot online slots. These include Megasaur, Shopping Spree II and Jackpot Pinatas. Spirit of the Inca offers an interesting twist to progressive jackpots. The jackpots trigger close to the indicated ‘boiling points’. This is the best time to start playing Spirit of the Inca. Some casino poker games like Caribbean Stud and Let ‘em Ride include progressive jackpots.
Deposits and Withdrawals
Perhaps, the biggest advantage for South African players at Apollo Slots Casino is that they can deposit, wager and withdraw in Rands. Therefore there is no currency exchange required. Currency exchange creates uncertainty because of exchange rate fluctuations and the associated cost eats into players’ bankrolls. South African players at Apollo Slots casino are protected from these disadvantages.
The deposit options at Apollo Slots are those that South African players would be familiar with. They include:
- Visa and MasterCard credit cards
- Neteller
- EcoPayz
- Skrill
- Internet transfers
- SID, which is a web-based payment service that enables South Africans to deposit funds at the online casino directly from their bank accounts.
- South African players can also deposit cash directly in the Apollo Slots bank account from anywhere in the country. Many players do not like to leave a trail of their gambling transactions and find this option useful.
There is only one withdrawal option available, however. All withdrawals will be compulsorily made by Apollo Slots directly to the players’ personal banking accounts in South Africa. Apollo Slots processes withdrawal requests within 2 working days, after which the payments are remitted. It may take up to 72 business hours for the funds to reach players’ accounts.
The online casino restricts payments up to R100000 per week. If you want to withdraw larger amounts because of big wins, the additional amount will be paid at a rate of R100000 per week.
In order to prevent fraudulent players from signing up, Apollo Slots is required to carry out verification of identity. For that purpose you will be asked to submit documents like valid passport, ID document or driver’s license. If you have opted for credit card deposit then you may be asked to submit documents proving ownership of the card.
Customer Support
If you any queries you should first check the FAQ section posted at the Apollo Slots web site. You will find answers to issues related to registration, technical issues, banking and bonuses. If you do not find the answer there, then you can contact the customer support team that operates round the clock. Apollo Slots provides the following options.
Email – You can send an email to support@apolloslots.com.
Live Chat – You can launch live chat to immediately connect to a representative.
In Our Blog
Week 12 Update – 6 New Casino Bonuses
We continuously to spoil you with some amazing no deposit bonuses. If you are a South African player, you are particularly in for a treat as two of our featured bonuses are available in Rands. Scroll down this list,...
Week 10 Update – 4 New No Deposit Bonus Offers at NoDepositKings
Get $10 now to begin your online casino journey through the Red Stag no deposit bonus. Or, play through 200 free spins at Spinit Casino today! The choice is yours. Out team at Nodepositkings.com makes it our mission to find...