Skip to content

Api framework graphql interfaces mark #32101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

/**
* Responsible for translating data produced by configuration readers to config objects
*
* @api
*/
interface ConfigElementFactoryInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@

/**
* GraphQL config element.
*
* @api
*/
interface ConfigElementInterface
{
/**
* @return string
*/
public function getName() : string;
public function getName(): string;

/**
* @return string
*/
public function getDescription() : string;
public function getDescription(): string;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
* Class representing 'field' GraphQL config element.
*
* Fields are used to describe possible values for a type/interface.
*
* @api
*/
class Field implements OutputFieldInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

/**
* Defines contract for fields data as GraphQL objects.
*
* @api
*/
interface FieldInterface extends ConfigElementInterface
{
Expand All @@ -19,7 +21,7 @@ interface FieldInterface extends ConfigElementInterface
*
* @return string
*/
public function getTypeName() : string;
public function getTypeName(): string;

/**
* Return true if argument is a list of input items, otherwise false if it is a single object/scalar.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

/**
* Defines contract for output fields data as GraphQL objects.
*
* @api
*/
interface OutputFieldInterface extends FieldInterface
{
Expand All @@ -17,12 +19,12 @@ interface OutputFieldInterface extends FieldInterface
*
* @return string
*/
public function getResolver() : string;
public function getResolver(): string;

/**
* Get the list of arguments configured for the field. Return an empty array if no arguments are configured.
*
* @return Argument[]
*/
public function getArguments() : array;
public function getArguments(): array;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

/**
* Defines contracts for return type data as GraphQL objects.
*
* @api
*/
interface TypeInterface extends ConfigElementInterface
{
Expand All @@ -19,5 +21,5 @@ interface TypeInterface extends ConfigElementInterface
*
* @return Field[]
*/
public function getFields() : array;
public function getFields(): array;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

/**
* Defines the contract for the union configuration data type.
*
* @api
*/
interface UnionInterface extends ConfigElementInterface
{
Expand Down
7 changes: 4 additions & 3 deletions lib/internal/Magento/Framework/GraphQl/ConfigInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@

/**
* Access all GraphQL type information declared in the schema's configuration.
*
* Data includes types, interfaces they implement, their arguments, and fields.
*
* @api
*/
interface ConfigInterface
{
Expand All @@ -22,7 +23,7 @@ interface ConfigInterface
* @param string $configElementName
* @return ConfigElementInterface
*/
public function getConfigElement(string $configElementName) : ConfigElementInterface;
public function getConfigElement(string $configElementName): ConfigElementInterface;

/**
* Return all type names declared in a GraphQL schema's configuration and their type.
Expand All @@ -31,5 +32,5 @@ public function getConfigElement(string $configElementName) : ConfigElementInter
*
* @return array $types
*/
public function getDeclaredTypes() : array;
public function getDeclaredTypes(): array;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*
* GraphQL error handler
*
* @api
* @see \Magento\Framework\GraphQl\Query\QueryProcessor
*/
interface ErrorHandlerInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

/**
* Contract for the classes that retrieve attributes for a given entity configured in @see FieldEntityAttributesPool.
*
* @api
*/
interface FieldEntityAttributesInterface
{
Expand All @@ -17,5 +19,5 @@ interface FieldEntityAttributesInterface
*
* @return array
*/
public function getEntityAttributes() : array;
public function getEntityAttributes(): array;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

/**
* Interface used to apply each argument to a search criteria
*
* @api
*/
interface ArgumentApplierInterface
{
Expand All @@ -28,5 +30,5 @@ public function applyArgument(
string $fieldName,
string $argumentName,
array $argument
) : SearchCriteriaInterface;
): SearchCriteriaInterface;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

/**
* One of requests for a batch resolver to process.
*
* @api
*/
interface BatchRequestItemInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

/**
* Resolve multiple requests of the same field gathered by GraphQL.
*
* @api
*/
interface BatchResolverInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

/**
* Contains responses for batch requests.
*
* @api
*/
class BatchResponse
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

/**
* Resolve multiple brunches/leaves by executing a batch service contract.
*
* @api
*/
interface BatchServiceContractResolverInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
*
* GraphQL will pass the same instance of this interface to each field resolver, so these resolvers could have
* shared access to the same data for ease of implementation purposes.
*
* @api
*/
interface ContextInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

/**
* IdentityInterface is responsible for generating the proper tags from a cache tag and resolved data.
*
* @api
*/
interface IdentityInterface
{
Expand All @@ -21,5 +23,5 @@ interface IdentityInterface
* @param array $resolvedData
* @return string[]
*/
public function getIdentities(array $resolvedData) : array;
public function getIdentities(array $resolvedData): array;
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

/**
* Request for a resolver.
*
* @api
*/
interface ResolveRequestInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

/**
* Determines a concrete GraphQL type for data returned that implements an interface type.
*
* @api
*/
interface TypeResolverInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

/**
* Return value for @see ResolverInterface
*
* @api
*/
class Value extends \GraphQL\Deferred
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

/**
* Resolver fetches the data and formats it according to the GraphQL schema.
*
* @api
*/
interface ResolverInterface
{
Expand Down
2 changes: 2 additions & 0 deletions lib/internal/Magento/Framework/GraphQl/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

/**
* Schema object for a GraphQL endpoint describing queries and types for a client to consume.
*
* @api
*/
class Schema extends \GraphQL\Type\Schema
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

/**
* GraphQL schema generator interface.
*
* @api
*/
interface SchemaGeneratorInterface
{
Expand All @@ -19,5 +21,5 @@ interface SchemaGeneratorInterface
*
* @return Schema
*/
public function generate() : Schema;
public function generate(): Schema;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

/**
* Produces mapped GraphQL type names to their respective entity models.
*
* @api
*/
interface MapperInterface
{
Expand All @@ -18,5 +20,5 @@ interface MapperInterface
* @param string $entityName
* @return string[]
*/
public function getMappedTypes(string $entityName) : array;
public function getMappedTypes(string $entityName): array;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

/**
* Produces mapped name to values for the Enum types to be map them against the data that comes from a database.
*
* @api
*/
interface DataMapperInterface
{
Expand All @@ -18,5 +20,5 @@ interface DataMapperInterface
* @param string $enumName
* @return string[]
*/
public function getMappedEnums(string $enumName) : array;
public function getMappedEnums(string $enumName): array;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@

/**
* Interface for GraphQl InputType only used for input
*
* @api
*/
interface InputTypeInterface extends \GraphQL\Type\Definition\InputType, TypeInterface
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

/**
* Converter of GraphQL config elements to the objects compatible with GraphQL schema generator.
*
* @api
*/
interface FormatterInterface
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@

/**
* Interface for GraphQl OutputType only used for output
*
* @api
*/
interface OutputTypeInterface extends \GraphQL\Type\Definition\OutputType, TypeInterface
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

/**
* Wrapper for GraphQl ResolveInfo
*
* @api
*/
class ResolveInfo extends \GraphQL\Type\Definition\ResolveInfo
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@

/**
* Interface for GraphQl WrappedType used to wrap other types like array or not null
*
* @api
*/
interface WrappedTypeInterface extends \GraphQL\Type\Definition\WrappingType, TypeInterface
{

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@

/**
* Marker interface for all types compatible with GraphQL schema generator.
*
* @api
*/
interface TypeInterface
{

}
Loading