Skip to content

Instantly share code, notes, and snippets.

View Mr-Malomz's full-sized avatar

Demola Malomo Mr-Malomz

  • Lagos, Nigeria
View GitHub Profile
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,
//add modules
mod config;
mod handler;
mod schemas;
fn main() {
println!("Hello, world!");
}
//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"
//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
}
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"
)
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"
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"
)
type Owner {
_id: String!
name: String!
email: String!
phone: String!
}
type Project {
_id: String!
ownerId: ID!
@Mr-Malomz
Mr-Malomz / token.json
Created July 21, 2022 07:35
Whatagraph Token
{
"Blue": {
"50": {
"value": "#e9effd",
"type": "color"
},
"100": {
"value": "#d3e0fb",
"type": "color"
},
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 = () => {