Git Product home page Git Product logo

Comments (20)

kamilkisiela avatar kamilkisiela commented on September 27, 2024 1

graphql-hive

Where do you import from in your library?

  • graphql

(If you use deep imports) why do you use deep imports?

  • import { validateSDL } from 'graphql/validation/validate' - as I only need to validate SDL, not build GraphQLSchema

Would it be okay for you only import from graphql, too?

  • yes
  • no

from graphql-js.

phryneas avatar phryneas commented on September 27, 2024

@apollo/client

Where do you import from in your library?

  • graphql

(If you use deep imports) why do you use deep imports?

Would it be okay for you only import from graphql, too?

  • yes
  • no

from graphql-js.

phryneas avatar phryneas commented on September 27, 2024

graphql-tag

Where do you import from in your library?

  • graphql
  • graphql/language/ast

(If you use deep imports) why do you use deep imports?

Maybe for historical reasons, but everything we import is also exported from graphql itself.

Would it be okay for you only import from graphql, too?

  • yes
  • no

from graphql-js.

benjie avatar benjie commented on September 27, 2024

grafast

Where do you import from in your library?

  • graphql
  • graphql/jsutils/PromiseOrValue
  • graphql/execution/execute
  • graphql/type/schema

(If you use deep imports) why do you use deep imports?

  • graphql/jsutils/PromiseOrValue
    • the type isn't exported directly, and redefining it in every file is annoying. Also, auto-import pulls it in
  • graphql/execution/execute (specifically the buildExecutionContext function)
    • In order to emulate GraphQLResolveInfo as used in GraphQL resolvers, Grafast needs to get the same execution context. It also needs to coerce the variables and do all the other things that buildExecutionContext does (and isn't where Grafast adds value); so it makes sense to use the underlying function.
  • graphql/type/schema
    • specifically the type GraphQLSchemaNormalizedConfig which is marked as internal but used as the return type of schema.toConfig(). Could be worked around via ReturnType<GraphQLSchema['toConfig']> or similar.

Would it be okay for you only import from graphql, too?

  • yes
  • no

from graphql-js.

trevor-scheer avatar trevor-scheer commented on September 27, 2024

@apollo/server

Where do you import from in your library?

  • graphql

(If you use deep imports) why do you use deep imports?

Would it be okay for you only import from graphql, too?

  • yes
  • no

from graphql-js.

n1ru4l avatar n1ru4l commented on September 27, 2024

graphql-yoga

Where do you import from in your library?

  • graphql
  • graphql/jsutils/Maybe (only in tests for convenience)
  • graphql/validation/validate (only for test helpers)
  • graphql/validation/ValidationContext (for tests)

(If you use deep imports) why do you use deep imports?

See comments behind the import - we only use them in tests for testing specific features of the GraphQL server

Would it be okay for you only import from graphql, too?

  • yes (if the things are exported from the main graphql entry, as it would be annoying to double maintain the declarations ourself
  • no

from graphql-js.

n1ru4l avatar n1ru4l commented on September 27, 2024

@envelop/fragment-arguments

Where do you import from in your library?

  • graphql
  • graphql/language/lexer.js
  • graphql/language/parser.js

(If you use deep imports) why do you use deep imports?

Types for Parser and Lexer for extending and adding new functionality

Would it be okay for you only import from graphql, too?

  • yes, (if the types are explorer from the main graphql entry)
  • no

from graphql-js.

enisdenjo avatar enisdenjo commented on September 27, 2024

graphql-http

Where do you import from in your library?

  • graphql

(If you use deep imports) why do you use deep imports?

Would it be okay for you only import from graphql, too?

  • yes
  • no

from graphql-js.

enisdenjo avatar enisdenjo commented on September 27, 2024

graphql-sse

Where do you import from in your library?

  • graphql

(If you use deep imports) why do you use deep imports?

Would it be okay for you only import from graphql, too?

  • yes
  • no

from graphql-js.

enisdenjo avatar enisdenjo commented on September 27, 2024

graphql-ws

Where do you import from in your library?

  • graphql

(If you use deep imports) why do you use deep imports?

Would it be okay for you only import from graphql, too?

  • yes
  • no

from graphql-js.

saihaj avatar saihaj commented on September 27, 2024

graphql-codegen

Where do you import from in your library?

  • graphql

(If you use deep imports) why do you use deep imports?

Would it be okay for you only import from graphql, too?

  • yes
  • no

from graphql-js.

dariuszkuc avatar dariuszkuc commented on September 27, 2024

@apollo/composition

Where do you import from in your library?

  • graphql

(If you use deep imports) why do you use deep imports?

N/A

Would it be okay for you only import from graphql, too?

  • yes
  • no

from graphql-js.

dariuszkuc avatar dariuszkuc commented on September 27, 2024

@apollo/federation-internals

Where do you import from in your library?

  • graphql
  • graphql/jsutils/Maybe
  • graphql/validation/validate
  • graphql/validation/ValidationContext
  • graphql/validation/specifiedRules

(If you use deep imports) why do you use deep imports?

Used for SDL validations.

Would it be okay for you only import from graphql, too?

  • yes (assuming those validations are re-exported from root graphql entry)
  • no

from graphql-js.

dariuszkuc avatar dariuszkuc commented on September 27, 2024

@apollo/gateway

Where do you import from in your library?

  • graphql
  • graphql/execution/values

(If you use deep imports) why do you use deep imports?

Use getVariableValues while parsing the request.

Would it be okay for you only import from graphql, too?

  • yes
  • no

from graphql-js.

dariuszkuc avatar dariuszkuc commented on September 27, 2024

@apollo/query-planner

Where do you import from in your library?

  • graphql

(If you use deep imports) why do you use deep imports?

N/A

Would it be okay for you only import from graphql, too?

  • yes
  • no

from graphql-js.

dariuszkuc avatar dariuszkuc commented on September 27, 2024

@apollo/subgraph

Where do you import from in your library?

  • graphql
  • graphql/validation
  • graphql/validation/validate
  • graphql/validation/ValidationContext
  • graphql/validation/specifiedRules
  • graphql/jsutils/PromiseOrValue

(If you use deep imports) why do you use deep imports?

Used for SDL validations.

Would it be okay for you only import from graphql, too?

  • yes (assuming those validations are re-exported from root graphql entry)
  • no

from graphql-js.

jasonkuhrt avatar jasonkuhrt commented on September 27, 2024

Thanks @phryneas I just pushed a fix that removed deep imports wherever I can. The following is up to date with that.


graphql-request

Where do you import from in your library?

import { ... } from 'graphql'
import { type ObjMap } from 'graphql/jsutils/ObjMap.js'

(If you use deep imports) why do you use deep imports?

To access ObjMap which is the type of some data structures exposed by graphql library.

Would it be okay for you only import from graphql, too?

  • yes [1]
  • no

[1] Except for ObjMap type which is currently not exported from graphql. Worst case I could copy the type into my package.

from graphql-js.

AnthonyMDev avatar AnthonyMDev commented on September 27, 2024

apollo-ios

Where do you import from in your library?

  • graphql
  • graphql/validation/validate
  • graphql/language/ast

(If you use deep imports) why do you use deep imports?

To access validateSDL (validation) and isNode (ast)

Would it be okay for you only import from graphql, too?

  • yes
  • no

from graphql-js.

dylanaubrey avatar dylanaubrey commented on September 27, 2024

graphql-box

Where do you import from in your library?

  • graphql
  • graphql/jsutils/PromiseOrValue

(If you use deep imports) why do you use deep imports?

Would it be okay for you only import from graphql, too?

  • yes
  • no

from graphql-js.

benjie avatar benjie commented on September 27, 2024

A new library I'm working on needs isNode to be exported (currently imported from graphql/language/ast).

from graphql-js.

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.