All Versions
11
Latest Version
Avg Release Cycle
48 days
Latest Release
1727 days ago

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.
  • 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

  • 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 optional context_factory parameter to the register_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 the execute or subscribe method.

  • v1.0.0 Changes

    September 12, 2019

    [1.0.0] -- 2019-09-12

    ๐Ÿ”„ Changed

    • โฌ†๏ธ Bump subscriptions-transport-ws from 0.7.0 to 0.8.3
    • โฌ†๏ธ Bump graphiql from 0.12.0 to 0.14.2
    • โšก๏ธ Update aiohttp requirement from >=3.5.4,<3.6.0 to >=3.5.4,<3.7.0
    • โฌ†๏ธ Bump pytest from 5.1.1 to 5.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
  • v0.8.5 Changes

    September 05, 2019

    [0.8.5] -- 2019-09-04

    ๐Ÿ›  Fixed

    • Properly injects the executor_context into the aiohttp subscription handler #25 thrown by @jonypawks
  • 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

    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 the engine 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 method create_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'] ) )