v15.0.0-alpha.2
Pre-release
Pre-release
·
549 commits
to master
since this release
Changed
- PHP version required: 7.4+
- Propagate error message and stack trace for why leaf value serialization failed
- Do not throw client safe
Errorwhen failing to serialize an Enum type - Use native PHP types for properties of
Typeand its subclasses - Throw
SerializationErrorover client safeErrorwhen failing to serialize leaf types - Move debug entries in errors under
extensionskey - Use native PHP types wherever possible
- Always throw
RequestErrorwith useful message when clients provide an invalid JSON body - Move class
BlockStringfrom namespaceGraphQL\UtilstoGraphQL\Language - Return string-keyed arrays from
GraphQL::getStandardDirectives(),GraphQL::getStandardTypes()andGraphQL::getStandardValidationRules() - Move complexity related code from
FieldDefinitiontoQueryComplexity - Exclude unused standard types from the schema
- Require lazy type loader to return
Typedirectly without an intermediary callable - Allow lazy type loader to return
null - Rename
ServerConfigoptionpersistentQueryLoadertopersistedQueryLoader - Call previously unused methods
EnumType::parseValue()andEnumType::parseLiteral() - Strongly type
PromiseAdapter::createRejected()to require\Throwable - Move members specific to
NamedTypeout ofType:$name,$description,$config,isBuiltInType(),assertValid() - Always convert recursively when calling
Node::toArray() - Make
Directive::$config['args']use the same definition style asFieldDefinition::$config['args'] - Rename
FieldArgumenttoArgument - Make errors when parsing scalar literals more precise
- Change expected
QueryPlanoptions from['group-implementor-fields']to['groupImplementorFields' => true]inResolveInfo::lookAhead() - Always convert promises through
PromiseAdapter::convertThenable()before calling->then()on them - Use
JSON_THROW_ON_ERRORinjson_encode() - Validate some internal invariants through
assert() PromiseAdapter::all()acceptsiterable- Throw if
Introspection::fromSchema()returns no data - Reorganize abstract class
ASTValidationContextto interfaceValidationContext - Reorganize AST interfaces related to schema and type extensions
- Align
Utils::suggestionList()with the reference implementation (#1075) - Order schema topologically and according to the user-defined order, affects introspection and printing
GraphQL\Utils\AST::typeFromAST()now needs a type loader callable instead of the Schema- Do not change HTTP status code in
StandardServer - Use
"instead of"""for single line descriptions - Make
Helper::emitResponse()private, useHelper::sendResponse() - Emit unescaped UTF-8 from
StandardServer - Sync input value coercion with
graphql-jsreference implementation
Added
- Improve extendability of validator rules
- Add tests for errors that occur when undeclared fields are passed in input
- Warn about orphaned object types
- Expose structured enumeration of directive locations
- Add
AST::concatAST()utility - Allow lazy input object fields
- Add validation rule
UniqueEnumValueNames - Add SDL validation rule
UniqueOperationTypes(#995) - Add ability to remove custom validation rules after adding them via
DocumentValidator::removeRule() - Allow lazy enum values
- Make
NodeimplementJsonSerializable - Add SDL validation rule
UniqueTypeNames(#998) - Add support for SDL validation to
KnownTypeNamesrule (#999) - Add SDL validation rule
UniqueArgumentDefinitionNames(#1136) - Add
parseValueconfig option to InputObjectType to parse input value to custom value object - Add option
sortTypesto haveSchemaPrinterorder types alphabetically - Allow constructing
EnumTypefrom PHP enum - Add
TypeInfo::getParentTypeStack()andTypeInfo::getFieldDefStack() - Include path to faulty input in coercion errors
- Add ability to resolve abstract type of object via
__typename
Optimized
- Use recursive algorithm for printer and improve its performance
- Use
foreachover slower functionsarray_map()andUtils::map()
Fixed
- Avoid QueryPlan crash when multiple $fieldNodes are present
- Clarify error when attempting to coerce anything but
arrayorstdClassto an input object - Allow directives on variable definitions
- Handle
nullparent of list inValuesOfCorrectType::getVisitor - Allow sending both
queryandqueryId, ignorequeryIdin that case - Preserve extended methods from class-based types in
SchemaExtender::extend() - Fix printing of empty types (#940)
- Clone
NodeListinNode::cloneDeep() - Calling
Schema::getType()on a schema built from SDL returnsnullfor unknown types (#1068) - Avoid crash on typeless inline fragment when using
QueryComplexityrule - Avoid calling
FormattedError::addDebugEntries()twice when using default error formatting - Avoid calling defined functions named like lazily loaded types
- Show actual error in debug entries
Removed
- Remove
OperationParamsmethodgetOriginalInput()in favor of public property$originalInput - Remove
OperationParamsmethodisReadOnly()in favor of public property$readOnly - Remove
Utils::withErrorHandling() - Remove
TypeComparators::doTypesOverlap() - Remove
DocumentValidator::isError() - Remove
DocumentValidator::append() - Remove
Utils::getVariableType()in favor ofUtils::printSafe() - Remove warning for passing
isDeprecatedin field definition config - Remove
WrappingType::getWrappedType()argument$recursein favor ofWrappingType::getInnermostType() - Remove
Type::assertType() - Remove
ListOfType::$ofType,ListOfType::getOfType()andNonNull::getOfType() - Remove option
commentDescriptionsfromBuildSchema::buildAST(),BuildSchema::build()andPrinter::doPrint() - Remove parameter
$optionsfromASTDefinitionBuilder - Remove
FieldDefinition::create()in favor ofnew FieldDefinition() - Remove
GraphQL\Exception\InvalidArgument - Remove
Utils::find(),Utils::every()andUtils::invariant() - Remove argument
bool $exitWhenDonefromStandardServer::send500Error()andStandardServer::handleRequest() - Remove
Schema::getAstNode()in favor ofSchema::$astNode - Remove ability to override standard types through
Schemaoptiontypes, useType::overrideStandardTypes() - Remove
GraphQL\Utils\TypeInfo::typeFromAST(), useGraphQL\Utils\AST::typeFromAST() - Remove
StandardServer::send500Error(), handle non-GraphQL errors yourself - Remove
StandardServer::getHelper(), usenew Helper - Remove error extension field
category, use custom error formatting if you still need it - Remove deprecated
Type::getInternalTypes() - Remove deprecated
GraphQL::execute() - Remove deprecated
GraphQL::executeAndReturnResult() - Remove deprecated experimental CoroutineExecutor
- Remove deprecated
FormattedError::create()andFormattedError::createFromPHPError() - Remove deprecated
GraphQL::setPromiseAdapter() - Remove deprecated
AST::getOperation() - Remove deprecated constants from
BreakingChangesFinder - Remove deprecated
DocumentValidator::isValidLiteralValue() - Remove deprecated
Error::formatError()andError::toSerializableArray() - Remove deprecated
GraphQL::getInternalDirectives() - Remove deprecated
Schema::isPossibleType() - Remove deprecated methods from
TypeInfo - Remove deprecated
Values::valueFromAST()andValues::isValidPHPValue() - Remove deprecated public property access to
InputObjectField::$type - Remove deprecated public property access to
FieldDefinition::$type - Remove alias
GraphQL\Validator\Rules\AbstractQuerySecurity, useGraphQL\Validator\Rules\QuerySecurityRule - Remove alias
GraphQL\Validator\Rules\AbstractValidationRule, useGraphQL\Validator\Rules\ValidationRule - Remove alias
GraphQL\Utils\FindBreakingChanges, useGraphQL\Utils\BreakingChangesFinder