Changelog History
Page 1
-
v1.3.1 Changes
September 24, 2020[1.3.1] - 2020-09-24
๐ Changed
- โ
Test platform:
- pytest to 6.0.2
- pytest-cov to 2.10.1
- pylint to 2.6.0
- isort to 5.5.3
- black to 20.8b1
- xenon to 0.7.1
๐ Fixed
- ISSUE-112 - Fix async context generator with subscription.
- โ
Test platform:
-
v1.3.0 Changes
August 01, 2020[1.3.0] - 2020-07-31
โ Added
โ Added a way to hook the response formatting stage of the request execution. Simply register a callable looking like:
def a_method(req: aiohttp.web.Request, data: Dict[str, Any], ctx: Dict[str, Any]) -> aiohttp.web.Response: pass
This is done via the
register_graphql_handler(..., response_formatter= a_method)
.๐ Changed
ISSUE-94 - Changed the context_factory from a simple async method to an asynccontextmanager decorated one - Thanks @jugdizh
โ Test platform:
- pytest from 5.3.4 -> 6.0.1
- pytest-asyncio from 0.10.0 -> 0.14.0
- pytest-cov from 2.8.1 -> 2.10.0
- pylint from 2.4.4 -> 2.5.3
๐ Fixed
- ISSUE-76 - Fix subscrition handling of client disconnection - Thanks @daveoconnor
-
v1.2.0 Changes
January 29, 2020[1.2.0] - 2020-01-29
โ Added
Possibility to set header to the response directly from the resolver using
set_response_headers
method.from tartiflette_aiohttp import set_response_headers@Resolver("Query.X")async def resolver_x(parent_result, args, ctx, info): # do thingsset_response_headers({"Header": "Value", "AnotherHeader": "AnotherValue"}) return result
Note that this feature uses ContextVar and will only works for python 3.7.1 and later.
๐ Changed
- โก๏ธ pytest updated to 5.3.4
- โก๏ธ pylint updated to 2.4.4
-
v1.1.1 Changes
October 15, 2019[1.1.1] - 2019-10-15
๐ Changed
- Github actions worflow. There is now only one.
- โก๏ธ xenon updated to 0.7.0
- โก๏ธ pytest updated to 5.2.1
- โก๏ธ pytest-cov updated to 2.8.1
-
v1.1.0 Changes
October 03, 2019[1.1.0] -- 2019-10-02
โ Added
ISSUE-55 - Add
a new optionalcontext_factory
parameter to theregister_graphql_handlers
function. This parameter can take a coroutine function which will be called on
each request with the following signature:async def context_factory( context: Dict[str, Any], req: "aiohttp.web.Request") -> Dict[str, Any]: """ Generates a new context. :param context: the value filled in through the
executor_context
parameter :param req: the incoming aiohttp request instance :type context: Dict[str, Any] :type req: aiohttp.web.Request :return: the context for the incoming request :rtype: Dict[str, Any] """
The aim of this function will be to returns the context which will be forwarded
to the Tartiflette engine on theexecute
orsubscribe
method. -
v1.0.0 Changes
September 12, 2019[1.0.0] -- 2019-09-12
๐ Changed
- โฌ๏ธ Bump
subscriptions-transport-ws
from0.7.0
to0.8.3
- โฌ๏ธ Bump
graphiql
from0.12.0
to0.14.2
- โก๏ธ Update
aiohttp
requirement from>=3.5.4,<3.6.0
to>=3.5.4,<3.7.0
- โฌ๏ธ Bump
pytest
from5.1.1
to5.1.2
- โก๏ธ Update
tartiflette
requirement from>=0.12.0,<0.13.0
to>=0.12.0,<2.0.0
- ISSUE-49 thrown by @aljinovic
๐ Fixed
- ๐ Fix
RuntimeError
when subscription connection is reset - ISSUE-50 thrown by @jonypawks - Determines the appropriate
ws
protocol to use depending on current used protocol - ISSUE-20 thrown by @bkcsfi
- โฌ๏ธ Bump
-
v0.8.5 Changes
September 05, 2019[0.8.5] -- 2019-09-04
๐ Fixed
- Properly injects the
executor_context
into theaiohttp
subscription handler #25 thrown by @jonypawks
- Properly injects the
-
v0.8.2 Changes
July 04, 2019[0.8.2] -- 2019-07-03
๐ Changed
- โก๏ธ Update dev dependancies
- โก๏ธ Update to tartiflette 0.12.x
-
v0.8.1 Changes
June 19, 2019[0.8.1] - 2019-06-19
๐ Fixed
- ๐ Fixed the issue #25 thrown by @arjandepooter
It was impossible to execute subscription with this piece of code.
def run(): app = web.Application() engine: Engine = create\_engine( ... ) web.run\_app( register\_graphql\_handlers( app=app, engine=engine, subscription\_ws\_endpoint="/ws", ) )
-
v0.8.0 Changes
June 18, 2019[0.8.0] - 2019-06-17
๐ Changed
- โฌ๏ธ Bump
tartiflette
version to <0.12.0,>=0.11.0. - โก๏ธ Update to the new
create_engine
API, breaking the way theengine
parameter works.
Before it was possible to do:
from tartiflette import Engineengine = Engine(sdl)ctx = { 'user\_service': user\_service}web.run\_app( register\_graphql\_handlers( app=web.Application(), engine=engine, executor\_context=ctx, executor\_http\_endpoint='/graphql', executor\_http\_methods=['POST', 'GET'] ) )
Typically you were able to provide your own already initialized
Engine
Instance.
Now the engine is issued by the coroutine returning methodcreate_engine
.You have 3 choice in order to provide your own Engine :
Provide a non-awaited create_engine
from tartiflette import create\_engineengine = create\_engine(sdl)ctx = { 'user\_service': user\_service}web.run\_app( register\_graphql\_handlers( app=web.Application(), engine=engine, executor\_context=ctx, executor\_http\_endpoint='/graphql', executor\_http\_methods=['POST', 'GET'] ) )
register_graphql_handlers
will await that coroutine. (It can be any coroutine that respect the create_engine prototype)Provide your own instance of child class of Engine
from tartiflette import Engineclass myEngine(Engine): def \_\_init\_\_(self, my, parameters): super().\_\_init\_\_() self.\_my = myself.\_parameters = parametersasync def cook( self, sdl: Union[str, List[str]], error\_coercer: Callable[[Exception], dict] = None, custom\_default\_resolver: Optional[Callable] = None, modules: Optional[Union[str, List[str]]] = None, schema\_name: str = "default", ): await super().cook( sdl, error\_coercer, custom\_default\_resolver, modules, schema\_name ) print(self.\_my, self.\_parameters)ctx = { 'user\_service': user\_service}web.run\_app( register\_graphql\_handlers( app=web.Application(), engine=myEngine(my, parameters), executor\_context=ctx, executor\_http\_endpoint='/graphql', executor\_http\_methods=['POST', 'GET'] ) )
Provide you instance of an Engine class composed with an Engine
from tartiflette import Engineclass myEngine: def \_\_init\_\_(self, my, parameters): self.\_engine = Engine() self.\_my = myself.\_parameters = parametersasync def cook( self, sdl: Union[str, List[str]], error\_coercer: Callable[[Exception], dict] = None, custom\_default\_resolver: Optional[Callable] = None, modules: Optional[Union[str, List[str]]] = None, schema\_name: str = "default", ): print(self.\_my) await self.\_engine.cook( sdl, error\_coercer, custom\_default\_resolver, modules, schema\_name ) print(self.\_parameters) async def execute( self, query: str, operation\_name: Optional[str] = None, context: Optional[Dict[str, Any]] = None, variables: Optional[Dict[str, Any]] = None, initial\_value: Optional[Any] = None, ): return await self.\_engine.execute( query, operation\_name, context, variables, initial\_value )ctx = { 'user\_service': user\_service}web.run\_app( register\_graphql\_handlers( app=web.Application(), engine=myEngine(my, parameters), executor\_context=ctx, executor\_http\_endpoint='/graphql', executor\_http\_methods=['POST', 'GET'] ) )
- โฌ๏ธ Bump