Skip to content

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
billy1624 committed Jan 10, 2025
1 parent 175d601 commit 9c49d96
Show file tree
Hide file tree
Showing 16 changed files with 19 additions and 45 deletions.
3 changes: 1 addition & 2 deletions examples/mysql/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ use axum::{
};
use dotenv::dotenv;
use sea_orm::Database;
use seaography::async_graphql;
use seaography::lazy_static;
use seaography::{async_graphql, lazy_static};
use std::env;
use tokio::net::TcpListener;

Expand Down
4 changes: 1 addition & 3 deletions examples/mysql/src/query_root.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use crate::entities::*;
use async_graphql::dynamic::*;
use sea_orm::DatabaseConnection;
use seaography::async_graphql;
use seaography::lazy_static;
use seaography::{Builder, BuilderContext};
use seaography::{async_graphql, lazy_static, Builder, BuilderContext};

lazy_static::lazy_static! { static ref CONTEXT : BuilderContext = BuilderContext :: default () ; }

Expand Down
4 changes: 1 addition & 3 deletions examples/mysql/tests/guard_mutation_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ use std::collections::BTreeMap;

use async_graphql::{dynamic::*, Response};
use sea_orm::{Database, DatabaseConnection};
use seaography::async_graphql;
use seaography::lazy_static;
use seaography::{Builder, BuilderContext, FnGuard, GuardsConfig};
use seaography::{async_graphql, lazy_static, Builder, BuilderContext, FnGuard, GuardsConfig};
use seaography_mysql_example::entities::*;

lazy_static::lazy_static! {
Expand Down
6 changes: 2 additions & 4 deletions examples/mysql/tests/guard_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ use std::collections::BTreeMap;

use async_graphql::{dynamic::*, Response};
use sea_orm::{Database, DatabaseConnection, RelationTrait};
use seaography::async_graphql;
use seaography::lazy_static;
use seaography::{
Builder, BuilderContext, EntityObjectRelationBuilder, EntityObjectViaRelationBuilder, FnGuard,
GuardsConfig,
async_graphql, lazy_static, Builder, BuilderContext, EntityObjectRelationBuilder,
EntityObjectViaRelationBuilder, FnGuard, GuardsConfig,
};

lazy_static::lazy_static! {
Expand Down
3 changes: 1 addition & 2 deletions examples/postgres/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ use async_graphql_poem::GraphQL;
use dotenv::dotenv;
use poem::{get, handler, listener::TcpListener, web::Html, IntoResponse, Route, Server};
use sea_orm::Database;
use seaography::async_graphql;
use seaography::lazy_static;
use seaography::{async_graphql, lazy_static};
use std::env;

lazy_static::lazy_static! {
Expand Down
4 changes: 1 addition & 3 deletions examples/postgres/src/query_root.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use crate::entities::*;
use async_graphql::dynamic::*;
use sea_orm::DatabaseConnection;
use seaography::async_graphql;
use seaography::lazy_static;
use seaography::{Builder, BuilderContext};
use seaography::{async_graphql, lazy_static, Builder, BuilderContext};

lazy_static::lazy_static! { static ref CONTEXT : BuilderContext = BuilderContext :: default () ; }

Expand Down
4 changes: 1 addition & 3 deletions examples/postgres/tests/guard_mutation_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ use std::collections::BTreeMap;

use async_graphql::{dynamic::*, Response};
use sea_orm::{Database, DatabaseConnection};
use seaography::async_graphql;
use seaography::lazy_static;
use seaography::{Builder, BuilderContext, FnGuard, GuardsConfig};
use seaography::{async_graphql, lazy_static, Builder, BuilderContext, FnGuard, GuardsConfig};
use seaography_postgres_example::entities::*;

lazy_static::lazy_static! {
Expand Down
6 changes: 2 additions & 4 deletions examples/postgres/tests/guard_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ use std::collections::BTreeMap;

use async_graphql::{dynamic::*, Response};
use sea_orm::{Database, DatabaseConnection, RelationTrait};
use seaography::async_graphql;
use seaography::lazy_static;
use seaography::{
Builder, BuilderContext, EntityObjectRelationBuilder, EntityObjectViaRelationBuilder, FnGuard,
GuardsConfig,
async_graphql, lazy_static, Builder, BuilderContext, EntityObjectRelationBuilder,
EntityObjectViaRelationBuilder, FnGuard, GuardsConfig,
};

lazy_static::lazy_static! {
Expand Down
3 changes: 1 addition & 2 deletions examples/sqlite/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ use async_graphql::{
use async_graphql_actix_web::{GraphQLRequest, GraphQLResponse};
use dotenv::dotenv;
use sea_orm::Database;
use seaography::async_graphql;
use seaography::lazy_static;
use seaography::{async_graphql, lazy_static};
use std::env;

lazy_static::lazy_static! {
Expand Down
4 changes: 1 addition & 3 deletions examples/sqlite/src/query_root.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
use crate::entities::*;
use async_graphql::dynamic::*;
use sea_orm::DatabaseConnection;
use seaography::async_graphql;
use seaography::lazy_static;
use seaography::{Builder, BuilderContext};
use seaography::{async_graphql, lazy_static, Builder, BuilderContext};

lazy_static::lazy_static! { static ref CONTEXT : BuilderContext = BuilderContext :: default () ; }

Expand Down
4 changes: 1 addition & 3 deletions examples/sqlite/tests/guard_mutation_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ use std::collections::BTreeMap;

use async_graphql::{dynamic::*, Response};
use sea_orm::{Database, DatabaseConnection};
use seaography::async_graphql;
use seaography::lazy_static;
use seaography::{Builder, BuilderContext, FnGuard, GuardsConfig};
use seaography::{async_graphql, lazy_static, Builder, BuilderContext, FnGuard, GuardsConfig};
use seaography_sqlite_example::entities::*;

lazy_static::lazy_static! {
Expand Down
6 changes: 2 additions & 4 deletions examples/sqlite/tests/guard_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ use std::collections::BTreeMap;

use async_graphql::{dynamic::*, Response};
use sea_orm::{Database, DatabaseConnection, RelationTrait};
use seaography::async_graphql;
use seaography::lazy_static;
use seaography::{
Builder, BuilderContext, EntityObjectRelationBuilder, EntityObjectViaRelationBuilder, FnGuard,
GuardsConfig,
async_graphql, lazy_static, Builder, BuilderContext, EntityObjectRelationBuilder,
EntityObjectViaRelationBuilder, FnGuard, GuardsConfig,
};

lazy_static::lazy_static! {
Expand Down
3 changes: 1 addition & 2 deletions generator/src/templates/actix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ pub fn generate_main(crate_name: &str) -> TokenStream {

quote! {
use actix_web::{guard, web, web::Data, App, HttpResponse, HttpServer, Result};
use seaography::async_graphql;
use async_graphql::{
dynamic::*,
http::{playground_source, GraphQLPlaygroundConfig},
};
use async_graphql_actix_web::{GraphQLRequest, GraphQLResponse};
use dotenv::dotenv;
use seaography::lazy_static;
use sea_orm::Database;
use seaography::{async_graphql, lazy_static};
use std::env;

lazy_static::lazy_static! {
Expand Down
3 changes: 1 addition & 2 deletions generator/src/templates/axum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ pub fn generate_main(crate_name: &str) -> TokenStream {
let crate_name_token: TokenStream = crate_name.replace('-', "_").parse().unwrap();

quote! {
use seaography::async_graphql;
use async_graphql::http::{playground_source, GraphQLPlaygroundConfig};
use async_graphql_axum::GraphQL;
use axum::{
Expand All @@ -19,8 +18,8 @@ pub fn generate_main(crate_name: &str) -> TokenStream {
Router,
};
use dotenv::dotenv;
use seaography::lazy_static;
use sea_orm::Database;
use seaography::{async_graphql, lazy_static};
use std::env;
use tokio::net::TcpListener;

Expand Down
3 changes: 1 addition & 2 deletions generator/src/templates/poem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ pub fn generate_main(crate_name: &str) -> TokenStream {
let crate_name_token: TokenStream = crate_name.replace('-', "_").parse().unwrap();

quote! {
use seaography::async_graphql;
use async_graphql::http::{playground_source, GraphQLPlaygroundConfig};
use async_graphql_poem::GraphQL;
use dotenv::dotenv;
use seaography::lazy_static;
use poem::{get, handler, listener::TcpListener, web::Html, IntoResponse, Route, Server};
use sea_orm::Database;
use seaography::{async_graphql, lazy_static};
use std::env;

lazy_static::lazy_static! {
Expand Down
4 changes: 1 addition & 3 deletions generator/src/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,9 @@ pub fn generate_query_root<P: AsRef<Path>>(entities_path: &P) -> TokenStream {

quote! {
use crate::entities::*;
use seaography::async_graphql;
use seaography::lazy_static;
use async_graphql::dynamic::*;
use sea_orm::DatabaseConnection;
use seaography::{Builder, BuilderContext};
use seaography::{async_graphql, lazy_static, Builder, BuilderContext};

lazy_static::lazy_static! {
static ref CONTEXT: BuilderContext = BuilderContext::default();
Expand Down

0 comments on commit 9c49d96

Please sign in to comment.