Skip to content

Commit c37808e

Browse files
authored
Merge pull request #213 from moufmouf/semver
Adding SemVer promise
2 parents cd7009b + d338926 commit c37808e

13 files changed

+77
-1
lines changed

docs/semver.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
id: semver
3+
title: Our backward compatibility promise
4+
sidebar_label: Semantic versioning
5+
---
6+
7+
Ensuring smooth upgrades of your project is a priority. That's why we promise you backward compatibility (BC) for all
8+
minor GraphQLite releases. You probably recognize this strategy as [Semantic Versioning](https://semver.org/). In short,
9+
Semantic Versioning means that only major releases (such as 4.0, 5.0 etc.) are allowed to break backward compatibility.
10+
Minor releases (such as 4.0, 4.1 etc.) may introduce new features, but must do so without breaking the existing API of
11+
that release branch (4.x in the previous example).
12+
13+
But sometimes, a new feature is not quite "dry" and we need a bit of time to find the perfect API.
14+
In such cases, we prefer to gather feedback from real-world usage, adapt the API, or remove it altogether.
15+
Doing so is not possible with a no BC-break approach.
16+
17+
To avoid being bound to our backward compatibility promise, such features can be marked as **unstable** or **experimental**
18+
and their classes and methods are marked with the `@unstable` or `@experimental` tag.
19+
20+
`@unstable` or `@experimental` classes / methods will **not break** in a patch release, but *may be broken* in a minor version.
21+
22+
As a rule of thumb:
23+
24+
- If you are a GraphQLite user (using GraphQLite mainly through its annotations), we guarantee strict semantic versioning
25+
- If you are extending GraphQLite features (if you are developing custom annotations, or if you are developing a GraphQlite integration
26+
with a framework...), be sure to check the tags.
27+
28+
Said otherwise:
29+
30+
- If you are a GraphQLite user, in your `composer.json`, target a major version:
31+
```json
32+
{
33+
"require": {
34+
"thecodingmachine/graphqlite": "^4"
35+
}
36+
}
37+
```
38+
- If you are extending the GraphQLite ecosystem, in your `composer.json`, target a minor version:
39+
```json
40+
{
41+
"require": {
42+
"thecodingmachine/graphqlite": "~4.1.0"
43+
}
44+
}
45+
```
46+
47+
Finally, classes / methods annotated with the `@internal` annotation are not meant to be used in your code or third-party library.
48+
They are meant for GraphQLite internal usage and they may break anytime. Do not use those directly.

src/Context/ContextInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
/**
1111
* A context class that should be passed to the Webonyx executor.
12+
*
13+
* @unstable See https://graphqlite.thecodingmachine.io/docs/semver.html
1214
*/
1315
interface ContextInterface
1416
{

src/Mappers/CannotMapTypeExceptionInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
use TheCodingMachine\GraphQLite\Annotations\SourceFieldInterface;
1212
use Throwable;
1313

14+
/**
15+
* @unstable See https://graphqlite.thecodingmachine.io/docs/semver.html
16+
*/
1417
interface CannotMapTypeExceptionInterface extends Throwable
1518
{
1619
public function addParamInfo(ReflectionParameter $parameter): void;

src/Mappers/RecursiveTypeMapperInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
* Maps a PHP class to a GraphQL type.
1919
*
2020
* Unlike the TypeMapperInterface, if a given class does not map a type, parent classes are explored.
21+
*
22+
* @unstable See https://graphqlite.thecodingmachine.io/docs/semver.html
2123
*/
2224
interface RecursiveTypeMapperInterface
2325
{

src/Mappers/TypeMapperInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
/**
1717
* Maps a PHP class to a GraphQL type
18+
*
19+
* @unstable See https://graphqlite.thecodingmachine.io/docs/semver.html
1820
*/
1921
interface TypeMapperInterface
2022
{

src/Middlewares/FieldHandlerInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
use GraphQL\Type\Definition\FieldDefinition;
88
use TheCodingMachine\GraphQLite\QueryFieldDescriptor;
99

10+
/**
11+
* @unstable See https://graphqlite.thecodingmachine.io/docs/semver.html
12+
*/
1013
interface FieldHandlerInterface
1114
{
1215
/**

src/Middlewares/FieldMiddlewareInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
/**
1111
* A middleware use to process annotations when evaluating a field/query/mutation
12+
*
13+
* @unstable See https://graphqlite.thecodingmachine.io/docs/semver.html
1214
*/
1315
interface FieldMiddlewareInterface
1416
{

src/NamingStrategyInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
use TheCodingMachine\GraphQLite\Annotations\Factory;
88
use TheCodingMachine\GraphQLite\Annotations\Type;
99

10+
/**
11+
* @unstable See https://graphqlite.thecodingmachine.io/docs/semver.html
12+
*/
1013
interface NamingStrategyInterface
1114
{
1215
/**

src/Parameters/InputTypeParameterInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
use GraphQL\Type\Definition\InputType;
88
use GraphQL\Type\Definition\ResolveInfo;
99

10+
/**
11+
* @unstable See https://graphqlite.thecodingmachine.io/docs/semver.html
12+
*/
1013
interface InputTypeParameterInterface extends ParameterInterface
1114
{
1215
/**

src/Parameters/ParameterInterface.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
/**
1010
* Instances of ParameterInterface represent a single PHP parameter in a Query/Mutation/Field/Factory.
11+
*
12+
* @unstable See https://graphqlite.thecodingmachine.io/docs/semver.html
1113
*/
1214
interface ParameterInterface
1315
{

src/Security/AuthenticationServiceInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
namespace TheCodingMachine\GraphQLite\Security;
66

7+
/**
8+
* @unstable See https://graphqlite.thecodingmachine.io/docs/semver.html
9+
*/
710
interface AuthenticationServiceInterface
811
{
912
/**

src/Security/AuthorizationServiceInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
namespace TheCodingMachine\GraphQLite\Security;
66

7+
/**
8+
* @unstable See https://graphqlite.thecodingmachine.io/docs/semver.html
9+
*/
710
interface AuthorizationServiceInterface
811
{
912
/**

website/sidebars.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
"Security": ["authentication_authorization", "fine-grained-security", "implementing-security"],
77
"Performance": ["query-plan", "prefetch-method"],
88
"Advanced": ["file-uploads", "pagination", "custom-types", "field-middlewares", "argument-resolving", "extend_input_type", "multiple_output_types", "symfony-bundle-advanced", "laravel-package-advanced", "internals", "troubleshooting", "migrating"],
9-
"Reference": ["annotations_reference", "changelog"]
9+
"Reference": ["annotations_reference", "semver","changelog"]
1010
}
1111
}

0 commit comments

Comments
 (0)