rick-and-morty-api
rick-and-morty-api | graphql-query-example | |
---|---|---|
8 | 1 | |
958 | 6 | |
- | - | |
0.0 | 4.2 | |
about 1 year ago | about 1 year ago | |
JavaScript | TypeScript | |
BSD 3-clause "New" or "Revised" License | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
rick-and-morty-api
-
Implementing Infinite scroll in React apps
import { useEffect, useState } from "react"; import axios from "axios"; import "./App.css"; import InfiniteScroll from "react-infinite-scroll-component"; import CharacterCard from "./components/Card"; function App() { const [characters, setCharacters] = useState([]); const [page, setPage] = useState(1); const [hasMore, setHasMore] = useState(true); const [totalPages, setTotalPages] = useState(1); const fetchData = async () => { if (page == totalPages + 1) { setHasMore(false); return; } // <-----------------------------------------------> // waiting for 1 second before fetching data to show loading spinner, you can skip this await new Promise((resolve) => setTimeout(resolve, 1000)); // <-----------------------------------------------> const res = await axios.get( `https://rickandmortyapi.com/api/character?page=${page}` ); setCharacters((prevPosts) => [...prevPosts, ...res.data.results]); setTotalPages(res.data.info.pages); setPage((prevPage) => prevPage + 1); }; useEffect(() => { fetchData(); }, []); return (
Rick and Morty characters!h1> Loading...h4>} endMessage={
Yay! You have seen it allb> p> } > {/* Map over characters array and return JSX */} {characters.map((character, index) => ( ))} InfiniteScroll> div> ); } export default App;
-
Building a Modern Full-Stack MonoRepo Application: A Journey with GraphQL, NextJS, Bun, and AWS
This project was conceived as a coding challenge and a demonstration of integrating modern web technologies into a cohesive application. The core of this project involves leveraging GraphQL to interact with the open-source Rick and Morty API, a task I often set for potential hires.
-
How to Write a GraphQL Query
export const apolloClient = new ApolloClient({ uri: "https://rickandmortyapi.com/graphql", cache: new InMemoryCache({ typePolicies: { Query: { fields: { characters: { keyArgs: false, merge(existing: Characters, incoming: Characters) { return { ...incoming, results: [ ...(existing?.results || []), ...(incoming?.results || []), ], } satisfies Characters; }, }, }, }, }, }), });
-
CS50x Final Project
Hello, my fellow CS students! Are there any Rick & Morty fans here? Because I've just created an app called Portalpal for my final project. It's a fun little app designed to explore the Rick & Morty universe. With Portalpal, you can view, search, paginate, and filter characters. Additionally, you have the option to filter characters by episodes and locations. For the data, I utilized the rickandmorty API, which you can check out here: https://rickandmortyapi.com/. If you'd like to give it a try, here's the link to my app: https://portalpal.vercel.app/. I built it using React 18, and it took me about a month. I'm really proud of how it turned out! If you're interested, you can also find the source code for the app on my GitHub repository: https://github.com/kyawzinhtett/portalpal. Feel free to open an issue if you discover any errors.
- Where to get Free APIs to practice my web dev skills?
-
It's not much but it's mine. Rick and Morty info app. Feedback/code review welcome!
Just a small app consuming the Rick and Morty API showing some basic stats of each character such as last known location, species and what episode(s) they appear in.
-
How to upskill my API Testing.
Checkout https://rickandmortyapi.com and their https://rickandmortyapi.com/graphql
-
Does anybody know the API documentation tool used to build the Rick and Morty API?
Click the guys name in the footer. It’ll take you to his GitHub profile. There you can find the source code to the site and the API.
graphql-query-example
-
How to Write a GraphQL Query
I'll be sharing my tips and tricks along the way, and I hope that this article will be a valuable resource for anyone looking to learn about GraphQL. Feel free to explore the complete codebase in the GitHub repository.
What are some alternatives?
RickNMortyCompose - A Jetpack compose android app based on Rick and Morty Graphql
graphql-sequelize-generator - A Graphql API generator based on Sequelize.
foundation - GraphQL Foundation Charter and Legal Documents
TypeScript - TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
potter-db - A Harry Potter database for all your wizarding needs: Books, Characters, Movies, Spells, and Potions. Powered by https://github.com/danielschuster-muc/scrabby
bifrost - The PsychonautWiki API.
React - The library for web and native user interfaces.
CS50x - Harvard CS50x - 2023
JokeAPI - REST API that serves uniformly and well formatted jokes in JSON, XML, YAML or plain text format that also offers a great variety of filtering methods
rick-and-morty-api-site - The Rick and Morty API site