Skip to content

v15.0.0

Compare
Choose a tag to compare
@spawnia spawnia released this 06 Jan 12:18
· 353 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 Error when failing to serialize an Enum type
  • Use native PHP types for properties of Type and its subclasses
  • Throw SerializationError over client safe Error when failing to serialize leaf types
  • Move debug entries in errors under extensions key
  • Use native PHP types wherever possible
  • Always throw RequestError with useful message when clients provide an invalid JSON body
  • Move class BlockString from namespace GraphQL\Utils to GraphQL\Language
  • Return string-keyed arrays from GraphQL::getStandardDirectives(), GraphQL::getStandardTypes() and GraphQL::getStandardValidationRules()
  • Move complexity related code from FieldDefinition to QueryComplexity
  • Exclude unused standard types from the schema
  • Require lazy type loader to return Type directly without an intermediary callable
  • Allow lazy type loader to return null
  • Rename ServerConfig option persistentQueryLoader to persistedQueryLoader
  • Call previously unused methods EnumType::parseValue() and EnumType::parseLiteral()
  • Strongly type PromiseAdapter::createRejected() to require \Throwable
  • Move members specific to NamedType out of Type: $name, $description, $config, isBuiltInType(), assertValid()
  • Always convert recursively when calling Node::toArray()
  • Make Directive::$config['args'] use the same definition style as FieldDefinition::$config['args']
  • Rename FieldArgument to Argument
  • Make errors when parsing scalar literals more precise
  • Change expected QueryPlan options from ['group-implementor-fields'] to ['groupImplementorFields' => true] in ResolveInfo::lookAhead()
  • Always convert promises through PromiseAdapter::convertThenable() before calling ->then() on them
  • Use JSON_THROW_ON_ERROR in json_encode()
  • Validate some internal invariants through assert()
  • PromiseAdapter::all() accepts iterable
  • Throw if Introspection::fromSchema() returns no data
  • Reorganize abstract class ASTValidationContext to interface ValidationContext
  • 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, use Helper::sendResponse()
  • Emit unescaped UTF-8 from StandardServer
  • Sync input value coercion with graphql-js reference implementation
  • Store rules exclusively by class name in DocumentValidator
  • Reorder standard types as described in the GraphQL specification
  • Improve runtime performance by moving checks for duplicate/mismatching type instances to assert() or schema validation
  • Replace HasSelectionSet::$selectionSet with HasSelectionSet::getSelectionSet()
  • Replace TypeDefinitionNode::$name with TypeDefinitionNode::getName()
  • Replace TypeExtensionNode::$name with TypeExtensionNode::getName()

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 Node implement JsonSerializable
  • Add SDL validation rule UniqueTypeNames (#998)
  • Add support for SDL validation to KnownTypeNames rule (#999)
  • Add SDL validation rule UniqueArgumentDefinitionNames (#1136)
  • Add parseValue config option to InputObjectType to parse input value to custom value object
  • Add option sortTypes to have SchemaPrinter order types alphabetically
  • Allow constructing EnumType from PHP enum
  • Add TypeInfo::getParentTypeStack() and TypeInfo::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 foreach over slower functions array_map() and Utils::map()

Fixed

  • Avoid QueryPlan crash when multiple $fieldNodes are present
  • Allow instantiating multiple QueryPlan with different options
  • Clarify error when attempting to coerce anything but array or stdClass to an input object
  • Allow directives on variable definitions
  • Handle null parent of list in ValuesOfCorrectType::getVisitor
  • Allow sending both query and queryId, ignore queryId in that case
  • Preserve extended methods from class-based types in SchemaExtender::extend()
  • Fix printing of empty types (#940)
  • Clone NodeList in Node::cloneDeep()
  • Calling Schema::getType() on a schema built from SDL returns null for unknown types (#1068)
  • Avoid crash on typeless inline fragment when using QueryComplexity rule
  • 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
  • Deal with iterable in implementations of PromiseAdapter::all()

Removed

  • Remove OperationParams method getOriginalInput() in favor of public property $originalInput
  • Remove OperationParams method isReadOnly() in favor of public property $readOnly
  • Remove Utils::withErrorHandling()
  • Remove TypeComparators::doTypesOverlap()
  • Remove DocumentValidator::isError()
  • Remove DocumentValidator::append()
  • Remove Utils::getVariableType() in favor of Utils::printSafe()
  • Remove warning for passing isDeprecated in field definition config
  • Remove WrappingType::getWrappedType() argument $recurse in favor of WrappingType::getInnermostType()
  • Remove Type::assertType()
  • Remove ListOfType::$ofType, ListOfType::getOfType() and NonNull::getOfType()
  • Remove option commentDescriptions from BuildSchema::buildAST(), BuildSchema::build() and Printer::doPrint()
  • Remove parameter $options from ASTDefinitionBuilder
  • Remove FieldDefinition::create() in favor of new FieldDefinition()
  • Remove GraphQL\Exception\InvalidArgument
  • Remove Utils::find(), Utils::every() and Utils::invariant()
  • Remove argument bool $exitWhenDone from StandardServer::send500Error() and StandardServer::handleRequest()
  • Remove Schema::getAstNode() in favor of Schema::$astNode
  • Remove ability to override standard types through Schema option types, use Type::overrideStandardTypes()
  • Remove GraphQL\Utils\TypeInfo::typeFromAST(), use GraphQL\Utils\AST::typeFromAST()
  • Remove StandardServer::send500Error(), handle non-GraphQL errors yourself
  • Remove StandardServer::getHelper(), use new 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() and FormattedError::createFromPHPError()
  • Remove deprecated GraphQL::setPromiseAdapter()
  • Remove deprecated AST::getOperation()
  • Remove deprecated constants from BreakingChangesFinder
  • Remove deprecated DocumentValidator::isValidLiteralValue()
  • Remove deprecated Error::formatError() and Error::toSerializableArray()
  • Remove deprecated GraphQL::getInternalDirectives()
  • Remove deprecated Schema::isPossibleType()
  • Remove deprecated methods from TypeInfo
  • Remove deprecated Values::valueFromAST() and Values::isValidPHPValue()
  • Remove deprecated public property access to InputObjectField::$type
  • Remove deprecated public property access to FieldDefinition::$type
  • Remove alias GraphQL\Validator\Rules\AbstractQuerySecurity, use GraphQL\Validator\Rules\QuerySecurityRule
  • Remove alias GraphQL\Validator\Rules\AbstractValidationRule, use GraphQL\Validator\Rules\ValidationRule
  • Remove alias GraphQL\Utils\FindBreakingChanges, use GraphQL\Utils\BreakingChangesFinder