Repository
Current version released
4 years ago
Dependencies
deno.land/x
skypack.dev
fastest-validator@^1.8.0
Versions
FUNQL is Simply a new way to create web servers
What is FUNQL ?
funql is just a Native Graphql
- If you hate
gqland prefer to handle backend tasks with standard and robust methods. - If you experience difficulties in using graphql in your projects due to its inherent complexities namely, time-consuming typesafety.
- Despite the simplicity of REST APIs, you are likely to get caught in the process of life-cycles and middlewares, etc.
- If you hate the secrets under the hood of libraries or frameworks.
- If you love MongoDB and want to use its potential capabilities.
funql Is For You
Funql Basics
funql is just a sets of rules:
- You must send standard
JSON’sHTTP POSTrequest tohttp://localhost:${PORT}/funql - Your request should have
wantsobject in it.wantsobject should have 2 properties :modelanddoit.modelis one of your MongoDB schemas anddoitis one of your methods you write for that schema. - Your request should have
detailsobject in it,detailsobject should have 2 properties:setandget.
setis a group of proprieties you try to send in a request like properties you need for creating a schema or properties you need to sort or filter on getting documents from schema.getis an object to specify which fields client wants to retrieve.
- The structure of folders is quite important in a
funqlproject
Folder structure example indenoserver:
- project
a blog example- config
should have- utils
maybe- someUtils.ts
maybe - index.ts
should have
- someUtils.ts
- db.ts
maybe - redis.ts
maybe - index.ts
should have
- utils
- src
should have- utils
maybe- populateMany.ts
maybe - throwErr.ts
maybe - index.ts
should have
- populateMany.ts
- functions
should have- user
should have if we have an user schema- funcs
should have if we have common fns- getUsers.ts
maybe - …
maybe - index.ts
should have
- getUsers.ts
- adding.ts
maybe - login.ts
maybe - singing.ts
maybe - getting.ts
maybe - …
maybe - index.ts
should have
- funcs
- …
other models fns - index.ts
should have
- user
- schemas
should have- utils
maybe- someUtils.ts
maybe - someOtherUtils.ts
maybe - index.ts
should have
- someUtils.ts
- user.ts
maybe - post.ts
maybe - category.ts
maybe - …
maybe - index.ts
should have
- utils
- index.ts
should have
- utils
- index.ts
should have - script.json
should have if use denon
- config
Basic rules
schemas
every schema should have 4 seprate things :
- an inteface to describe and hint
functions
Features
- It uses the best capabilities of graphql idea.
- It uses the best design elements of REST API’s.
- It removes all unnecessary extra code, validation, repetitive procedures.
funqlfully implementsfunctional programmingcharacteristics. Everything is comprised of small functionsfunqlis fundamentally based onfs(function schema)architecture.
How to Install
- Firstly,
denomust be installed. - After that just run this line:
deno install -qAf --allow-read --allow-write --unstable https://deno.land/x/funql@0.0.35/funql.tsHow to Use It
To start using funql, just enter this command
funql --init [blog]blogis name of the project and for sake of simplicity, we create the blog project byfunqlbecausefunqlis just a concept with set of rulesblog projectuses mongoDB and redis. So install them, we recommend using denon for running project so after installdenonjust run :
denon starton the root of project directory.
After downloading dependencies, http://localhost:8000/ will be displayed on the console.
Now send this http request to retrieve data:
POST http://localhost:8000/funql HTTP/1.1
content-type: application/json
{
"wants": {
"model": "Country",
"doit": "adding"
},
"details": {
"set": {
"name": "iran",
"enName": "iran"
},
"get": {
"_id": 0,
"name": 0,
"cities": {
"_id": 1,
"name": 1
}
}
}
}Todo
| Language | Process | Description |
|---|---|---|
| Deno | 🔵 🔵 🔵 🔵 ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ | just starting |
| NodeJS | ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ | nothing for know |
| Golang | ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ | nothing for know |
| Rust | ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ ⚪️ | nothing for know |