Comments (5)
I got the same issue
Use the Stable version v3.0.0 which was released 10 days ago it works fine
other versions are not stable...
and im using [email protected]
from gqlify.
npm i [email protected]
helped me
from gqlify.
It seems related to the version of graphql
library.
After remove the graphql
and downgrade the @gqlify/server
to v1.1.7
, the application can start successfully.
However, I cannot make it works for any version higher than 1.1.7
from gqlify.
Unfortunately I can't yet provide any meaningful solutions as I'm still trying to get my head around how GQLify works under the hood in an attempt to find fixes for other issues, but I hope this may point someone with more knowledge of the intent and purpose of the library internals in the right direction.
There has been an update on ASTDefinitionBuilder
since [email protected]
and some internal fields have been removed.
IMHO using graphql-js
internals (as well as any other dependencies') should be probably reconsidered as it makes such issues impossible to avoid.
i.e. this:
export class ASTDefinitionBuilder {
_typeDefinitionsMap: TypeDefinitionsMap;
_options: ?BuildSchemaOptions;
_resolveType: TypeResolver;
_cache: ObjMap<GraphQLNamedType>;
constructor(
typeDefinitionsMap: TypeDefinitionsMap,
options: ?BuildSchemaOptions,
resolveType: TypeResolver,
) {
this._typeDefinitionsMap = typeDefinitionsMap;
this._options = options;
this._resolveType = resolveType;
// Initialize to the GraphQL built in scalars and introspection types.
this._cache = keyMap(
specifiedScalarTypes.concat(introspectionTypes),
type => type.name,
);
}
...
buildType(node: NamedTypeNode | TypeDefinitionNode): GraphQLNamedType {
const typeName = node.name.value;
if (!this._cache[typeName]) {
if (node.kind === Kind.NAMED_TYPE) {
const defNode = this._typeDefinitionsMap[typeName];
this._cache[typeName] = defNode
? this._makeSchemaDef(defNode)
: this._resolveType(node.name.value);
} else {
this._cache[typeName] = this._makeSchemaDef(node);
}
}
return this._cache[typeName];
}
became this:
export class ASTDefinitionBuilder {
_options: ?BuildSchemaOptions;
_resolveType: TypeResolver;
constructor(options: ?BuildSchemaOptions, resolveType: TypeResolver) {
this._options = options;
this._resolveType = resolveType;
}
...
buildType(astNode: TypeDefinitionNode): GraphQLNamedType {
const name = astNode.name.value;
if (stdTypeMap[name]) {
return stdTypeMap[name];
}
switch (astNode.kind) {
case Kind.OBJECT_TYPE_DEFINITION:
return this._makeTypeDef(astNode);
case Kind.INTERFACE_TYPE_DEFINITION:
return this._makeInterfaceDef(astNode);
case Kind.ENUM_TYPE_DEFINITION:
return this._makeEnumDef(astNode);
case Kind.UNION_TYPE_DEFINITION:
return this._makeUnionDef(astNode);
case Kind.SCALAR_TYPE_DEFINITION:
return this._makeScalarDef(astNode);
case Kind.INPUT_OBJECT_TYPE_DEFINITION:
return this._makeInputObjectDef(astNode);
}
// Not reachable. All possible type definition nodes have been considered.
/* istanbul ignore next */
throw new Error(
`Unexpected type definition node: "${inspect((astNode: empty))}".`,
);
}
...
My guess while having a first look is that this technique was being used to add the schema Types to this internal _typeDefinitionsMap
of allowed definitions to be validated, but [email protected]
uses a hard-coded list, coming from this file, so... no dice.
export const specifiedScalarTypes: $ReadOnlyArray<*> = [
GraphQLString,
GraphQLInt,
GraphQLFloat,
GraphQLBoolean,
GraphQLID,
];
This is the method that checks against it:
const stdTypeMap = keyMap(
specifiedScalarTypes.concat(introspectionTypes),
type => type.name,
);
@wwwy3y3 Does any of what I'm saying here make sense to you?
from gqlify.
Can confirm [email protected]
does not work with @gqlify/[email protected]
(both lastest at the time of writing). As @nezaidu said, installing [email protected]
seems to resolve the issue at this time.
from gqlify.
Related Issues (20)
- Atomic operation on nested array in GraphQL API
- Support firestore.FieldValue.serverTimestamp()
- Encapsulate payload in update passed to dataSource HOT 1
- Latest graphql causes error HOT 3
- I can't seem to find the docs to contribute HOT 2
- use @gqlify/firestore without cert & dbUrl HOT 2
- Security Features HOT 3
- implement apollo-server-lambda with MongoDataSource HOT 6
- Support Firestore sub-collections HOT 5
- Support changing the payload when updating.
- Support more operators
- Datamodel types without scalar fields break GQLify generation
- @unique dosen't work when I use it in another attibut
- Give it a new future HOT 1
- .
- latest graphql causes error again! HOT 1
- Data model relationship generation
- How to make a many-to-many relation in default data for memory datasource
- Project status?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gqlify.