Open phryneas opened 6 months ago
@apollo/client
graphql
graphql
, too?graphql-tag
graphql
graphql/language/ast
Maybe for historical reasons, but everything we import is also exported from graphql
itself.
graphql
, too?grafast
graphql
graphql/jsutils/PromiseOrValue
graphql/execution/execute
graphql/type/schema
graphql/jsutils/PromiseOrValue
graphql/execution/execute
(specifically the buildExecutionContext
function)
graphql/type/schema
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.graphql
, too?@apollo/server
graphql
graphql
, too?graphql-hive
graphql
import { validateSDL } from 'graphql/validation/validate'
- as I only need to validate SDL, not build GraphQLSchema
graphql
, too?graphql-yoga
graphql
graphql/jsutils/Maybe
(only in tests for convenience)graphql/validation/validate
(only for test helpers)graphql/validation/ValidationContext
(for tests)See comments behind the import - we only use them in tests for testing specific features of the GraphQL server
graphql
, too?graphql
entry, as it would be annoying to double maintain the declarations ourself@envelop/fragment-arguments
graphql
graphql/language/lexer.js
graphql/language/parser.js
Types for Parser and Lexer for extending and adding new functionality
graphql
, too?graphql
entry)graphql-http
graphql
graphql
, too?graphql-sse
graphql
graphql
, too?graphql-ws
graphql
graphql
, too?graphql-codegen
graphql
graphql
, too?@apollo/composition
graphql
N/A
graphql
, too?@apollo/federation-internals
graphql
graphql/jsutils/Maybe
graphql/validation/validate
graphql/validation/ValidationContext
graphql/validation/specifiedRules
Used for SDL validations.
graphql
, too?graphql
entry)@apollo/gateway
graphql
graphql/execution/values
Use getVariableValues
while parsing the request.
graphql
, too?@apollo/query-planner
graphql
N/A
graphql
, too?@apollo/subgraph
graphql
graphql/validation
graphql/validation/validate
graphql/validation/ValidationContext
graphql/validation/specifiedRules
graphql/jsutils/PromiseOrValue
Used for SDL validations.
graphql
, too?graphql
entry)Thanks @phryneas I just pushed a fix that removed deep imports wherever I can. The following is up to date with that.
graphql-request
import { ... } from 'graphql'
import { type ObjMap } from 'graphql/jsutils/ObjMap.js'
To access ObjMap
which is the type of some data structures exposed by graphql
library.
graphql
, too?[1] Except for ObjMap
type which is currently not exported from graphql
. Worst case I could copy the type into my package.
apollo-ios
graphql
graphql/validation/validate
graphql/language/ast
To access validateSDL
(validation) and isNode
(ast)
graphql
, too?graphql-box
graphql
graphql/jsutils/PromiseOrValue
graphql
, too?A new library I'm working on needs isNode
to be exported (currently imported from graphql/language/ast
).
In the April meeting of the graphql-js-wg, there was discussion about bundling changes in the
graphql
package (https://github.com/graphql/graphql-js/issues/4062). As these changes would also add anexports
field, @benjie suggested that we might want to have a restrictive set ofexports
entry points (onlygraphql
, maybe one or two more?), to discourage from deep-importing from implementation details we do not consider the public interface of the library and which would result in uninteded breaking changes upon e.g. code reorganization.In this issue, we want to collect libraries and how they are importing from
graphql
, to ensure that this is a feasible idea so we can discuss this further in the next graphql-js-wg meeting.If you are generally opposed to a change like this, this issue (or the next WG meeting) are a good place to write your concerns down :)
Please copy-paste this template into a comment and fill it out: