mirror of
https://github.com/aljazceru/landscape-template.git
synced 2026-01-23 16:24:21 +01:00
Merge branch 'graphql-functions' of https://github.com/bumi/makers.bolt.fun into bumi-graphql-functions
This commit is contained in:
@@ -1,19 +1,53 @@
|
||||
import { Project, ProjectCard, ProjectCategory } from "../utils/interfaces";
|
||||
import { gql, useQuery } from "@apollo/client";
|
||||
import data from "./mockData.json";
|
||||
|
||||
// export async function getAllCategories(): Promise<ProjectCategory[]> {
|
||||
// return data.categories as any;
|
||||
// }
|
||||
export async function getAllCategories(): Promise<ProjectCategory[]> {
|
||||
// let QUERY = gql`
|
||||
// query GetCategories {
|
||||
// allCategories {
|
||||
// id
|
||||
// title
|
||||
// }
|
||||
// }
|
||||
// `;
|
||||
return data.categories;
|
||||
}
|
||||
|
||||
// export async function getHottestProjects(): Promise<ProjectCard[]> {
|
||||
// return data.projectsCards as any;
|
||||
// }
|
||||
export async function getHottestProjects(): Promise<ProjectCard[]> {
|
||||
// let QUERY = gql`
|
||||
// query {
|
||||
// allProject {
|
||||
// id
|
||||
// cover_image
|
||||
// thumbnail_image
|
||||
// title
|
||||
// website
|
||||
// votes_count
|
||||
// }
|
||||
// }
|
||||
// `;
|
||||
return data.projectsCards;
|
||||
}
|
||||
|
||||
// export async function getProjectsByCategory(
|
||||
// categoryId: string
|
||||
// ): Promise<ProjectCard[]> {
|
||||
// return data.projectsCards as any;
|
||||
// }
|
||||
export async function getProjectsByCategory(
|
||||
categoryId: string
|
||||
): Promise<ProjectCard[]> {
|
||||
// let QUERY = gql`
|
||||
// query Categories($categoryId: Int!){
|
||||
// projectsByCategory(category_id: ${categoryId}) {
|
||||
// id
|
||||
// cover_image
|
||||
// thumbnail_image
|
||||
// title
|
||||
// website
|
||||
// lightning_address
|
||||
// votes_count
|
||||
// }
|
||||
// }
|
||||
// `;
|
||||
return data.projectsCards;
|
||||
}
|
||||
|
||||
// // returns the latest bunch of projects in each ( or some ) categories, and returns the hottest projects
|
||||
// export async function getLatestProjects(): Promise<
|
||||
@@ -26,5 +60,17 @@ import data from "./mockData.json";
|
||||
// }
|
||||
|
||||
export async function getProjectById(projectId: string): Promise<Project> {
|
||||
return data.project as any;
|
||||
// let QUERY = gql`
|
||||
// query Project(projectId: String!) {
|
||||
// getProject(id: $projectId) {
|
||||
// id
|
||||
// cover_image
|
||||
// thumbnail_image
|
||||
// title
|
||||
// website
|
||||
// votes_count
|
||||
// }
|
||||
// }
|
||||
// `;
|
||||
return data.project;
|
||||
}
|
||||
|
||||
@@ -104,28 +104,28 @@
|
||||
}
|
||||
],
|
||||
"project": {
|
||||
"id": 123123123,
|
||||
"cover_image": "https://s3-alpha-sig.figma.com/img/07b8/5d84/145942255afd215b3da26dbbf1dd03bd?Expires=1638144000&Signature=Cl1DUQJIUsrrFi48M~qU1r3Z0agGdy-uiNUao5g8-nu34QtoyWTFPXvaH3naSZBYqcPyKFq1jaXF6Mw1uj1hdWwGhXhMPLnKNJFFrGViVXhXu-3YeCPY9p4-IcieFJBZPVA~zDY8zxY5b06loWsINAVx4eMHRAhSWl~~Mca5PjlSXloiYrT00W-6c9m8gevfMMX~PsHQedzwYzg0j2DlnhPX8LbRkli1G2OxtCaFwo3~HGHXIlFGuGU1uXRvi1qBWrdjdsuWgIly1ekcFfJWAKmwYXk06EtCmfWRgGYbD7cBK~lwOkFofbf1LW0yqLv0hr4svwToH~3FiHenrCF-1g__&Key-Pair-Id=APKAINTVSUGEWH5XD5UA",
|
||||
"id": "0",
|
||||
"cover_image": "https://picsum.photos/id/10/1024/1024",
|
||||
"thumbnail_image": "https://s3-alpha-sig.figma.com/img/be1b/cd75/1baa911b3875134c0889d6755c4ba2cb?Expires=1638748800&Signature=DOiLciAA95w8gOvAowjiiR-ZPbmV1oGSRRK8YpE4ALMoe47pL7DifQxZvL1LQn~NRa0aLMoMk61521fbbGJeDAwk~j6fIm~iZAlMzQn7DdWy0wFR0uLQagOgpIiIXO-w8CeC14VoW-hrjIX5mDmOonJzkfoftGqIF1WCOmP2EuswyJpIngFdLb15gCex4Necs3vH2cuD9iSgWG2za97KfdXZP79ROyk2EN9Q3~a7RT4FTBBIlgKDLuFGSVRxReXVNajn~XSxBJh2de9dFVa3tOXkwJXu3jb0G4x-wRCaG-KmBhUOemuGtu5Fumh6goktGh~bIDwoHeUBVKFHAzaYgw__&Key-Pair-Id=APKAINTVSUGEWH5XD5UA",
|
||||
"title": "{Project Name}",
|
||||
"website": "https://www.project.com",
|
||||
"description": "Lorem ipsum dolor sit amet consectetur adipisicing elit. Distinctio nobis aliquam, minima assumenda earum sapiente pariatur cupiditate error nihil, eius corporis ratione unde perspiciatis tenetur ipsa aut ex consequatur maiores eligendi quidem exercitationem suscipit. Ex hic reprehenderit deleniti possimus culpa animi velit? Dolores, nemo quis minima sapiente sed laborum ipsam?",
|
||||
"title": "█████████",
|
||||
"website": "████████",
|
||||
"description": "██████████████████",
|
||||
"category": {
|
||||
"id": 124,
|
||||
"title": "DeFi"
|
||||
"id": "0",
|
||||
"title": "█████"
|
||||
},
|
||||
"tags": [
|
||||
{
|
||||
"id": 123,
|
||||
"title": "lightning"
|
||||
"id": "0",
|
||||
"title": "█████"
|
||||
},
|
||||
{
|
||||
"id": 333,
|
||||
"title": "payments"
|
||||
"id": "0",
|
||||
"title": "██████"
|
||||
},
|
||||
{
|
||||
"id": 444,
|
||||
"title": "lnurl-auth"
|
||||
"id": "0",
|
||||
"title": "█████"
|
||||
}
|
||||
],
|
||||
"screenShots": [
|
||||
@@ -134,6 +134,6 @@
|
||||
"",
|
||||
""
|
||||
],
|
||||
"votes_count": 123
|
||||
"votes_count": 0
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user