Coder Social home page Coder Social logo

Provide prelude about async-graphql HOT 5 CLOSED

async-graphql avatar async-graphql commented on April 28, 2024
Provide prelude

from async-graphql.

Comments (5)

sunli829 avatar sunli829 commented on April 28, 2024

I think so too, when I finish the job at hand, because I have added some new types. 😂

from async-graphql.

IcanDivideBy0 avatar IcanDivideBy0 commented on April 28, 2024

Just to give a hint on what should be in prelude, currently my project is not that much advanced but this might help a bit:

$ grep -irn 'use async_graphql' src

use async_graphql::{Context, FieldResult, ID};
use async_graphql::{Context, FieldResult, ID};
use async_graphql::{guard::Guard, Context, FieldResult, ID};
use async_graphql::{Context, FieldResult, ID};
use async_graphql::{Connection, Context, DataSource, FieldResult, ID};
use async_graphql::ID;
use async_graphql::{Connection, Context, DataSource, FieldResult, ID};
use async_graphql::SimpleBroker;
use async_graphql::{Connection, Context, Cursor, DataSource, EmptyEdgeFields, FieldResult, QueryOperation}
use async_graphql::FieldResult;
use async_graphql::{Json, ID};
use async_graphql::extensions::ApolloTracing;
use async_graphql::http::{playground_source, GQLResponse};
use async_graphql::{Data, QueryBuilder, Schema};

I personally write macros with full path, eg #[async_graphql::Object] I feel that having just #[Object] on top of the declaration is a too much generic name, if macros were renamed #[GraphQLObject] I think I'll go for this style.

So I'd definitly put Context, FieldResult, FieldError, InputValueError, InputValueResult ID for sure

Connection, Cursor et al is really tied to Relay, the usage seems pretty wide on the different places I worked with graphql tho, even if most of the time it's the only part of the spec that is used

from async-graphql.

sunli829 avatar sunli829 commented on April 28, 2024

Good suggestion, I will make a list tomorrow. 😊

from async-graphql.

phated avatar phated commented on April 28, 2024

Just my input, I think custom scalars and relay stuff shouldn't exist in the prelude. It would be very nice to have async_graphql::relay::prelude::* and async_graphql::custom_scalars::prelude::*

from async-graphql.

IcanDivideBy0 avatar IcanDivideBy0 commented on April 28, 2024

@phated I don't think relay and custom scalars need their own prelude, there's not much in those modules, they can be used as async_graphql::relay::* and async_graphql::scalars::*

from async-graphql.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.