This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use async_graphql::{Enum, InputObject, SimpleObject}; | |
use mongodb::bson::oid::ObjectId; | |
use serde::{Deserialize, Serialize}; | |
//owner schema | |
#[derive(Debug, Clone, Serialize, Deserialize, SimpleObject)] | |
pub struct Owner { | |
#[serde(skip_serializing_if = "Option::is_none")] | |
pub _id: Option<ObjectId>, | |
pub name: String, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//add modules | |
mod config; | |
mod handler; | |
mod schemas; | |
fn main() { | |
println!("Hello, world!"); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//other code section goes here | |
[dependencies] | |
actix-web = "4" | |
async-graphql = { version = "4.0", features = ["bson", "chrono"] } | |
async-graphql-actix-web = "4.0" | |
serde = "1.0.136" | |
dotenv = "0.15.0" | |
futures = "0.3" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//The remaining part of the code goes here | |
type FetchOwner struct { | |
ID string `json:"id" bson:"_id"` //modify here | |
} | |
type FetchProject struct { | |
ID string `json:"id" bson:"_id"` //modify here | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package graph | |
// This file will be automatically regenerated based on the schema, any resolver implementations | |
// will be copied through when generating and any unknown code will be moved to the end. | |
import ( | |
"context" | |
"project-mngt-golang-graphql/configs" //add this | |
"project-mngt-golang-graphql/graph/generated" | |
"project-mngt-golang-graphql/graph/model" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package configs | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"project-mngt-golang-graphql/graph/model" | |
"time" | |
"go.mongodb.org/mongo-driver/bson" | |
"go.mongodb.org/mongo-driver/bson/primitive" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package graph | |
// This file will be automatically regenerated based on the schema, any resolver implementations | |
// will be copied through when generating and any unknown code will be moved to the end. | |
import ( | |
"context" | |
"fmt" | |
"project-mngt-golang-graphql/graph/generated" | |
"project-mngt-golang-graphql/graph/model" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Owner { | |
_id: String! | |
name: String! | |
email: String! | |
phone: String! | |
} | |
type Project { | |
_id: String! | |
ownerId: ID! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Blue": { | |
"50": { | |
"value": "#e9effd", | |
"type": "color" | |
}, | |
"100": { | |
"value": "#d3e0fb", | |
"type": "color" | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Head from 'next/head'; | |
import { useEffect, useState } from 'react'; | |
import { appwriteSDK, accountSDK } from '../helper/utils'; | |
import styles from '../styles/Home.module.css'; | |
export default function Home() { | |
const [file, setFile] = useState(null); | |
const [name, setName] = useState(''); | |
const checkSession = () => { |