-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c6b128e
commit 06a72db
Showing
12 changed files
with
309 additions
and
92 deletions.
There are no files selected for viewing
This file contains 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import typing | ||
from src.models.formation import Formation | ||
import strawberry | ||
from src import db | ||
|
||
|
||
@strawberry.type | ||
class Book: | ||
title: str | ||
author: str | ||
|
||
|
||
def get_formations(): | ||
return db.session.query(Formation).all() |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from pydoc import resolve | ||
import typing | ||
from src.business_logic.formation.get_formation_details import ( | ||
Formation, | ||
get_formation_by_id, | ||
) | ||
from src.models import User | ||
import strawberry | ||
|
||
from src import db | ||
|
||
|
||
@strawberry.type | ||
class Book: | ||
title: str | ||
author: str | ||
|
||
|
||
def get_users(): | ||
return db.session.query(User).all() | ||
|
||
|
||
@strawberry.type | ||
class Query: | ||
users: typing.List[User] = strawberry.field(resolver=get_users) | ||
formation: Formation = strawberry.field(resolver=get_formation_by_id) | ||
|
||
|
||
schema = strawberry.Schema(Query) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from flask import Blueprint, Response, jsonify | ||
from strawberry.flask.views import GraphQLView | ||
|
||
from src.constants.http_status_codes import HTTP_200_OK | ||
|
||
from src.api.schema import schema | ||
|
||
graphql = Blueprint("graphql", __name__, url_prefix="/api/graphql") | ||
|
||
|
||
@graphql.route("/", methods=["POST", "GET"]) | ||
def gql() -> tuple[Response, int]: | ||
view = GraphQLView.as_view("graphql_view", schema=schema) | ||
return view() |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
from dataclasses import dataclass | ||
import strawberry | ||
|
||
|
||
@dataclass | ||
@strawberry.type | ||
class Job: | ||
id: str | ||
libelle: str | ||
|
This file contains 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
3 changes: 3 additions & 0 deletions
3
src/business_logic/formation/study/get_continuation_of_study.py
This file contains 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
This file contains 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
This file contains 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