profile
viewpoint
Tim Griesser tgriesser @cypress-io Philadelphia

jashkenas/backbone 27684

Give your JS App some Backbone with Models, Views, Collections, and Events

jashkenas/underscore 25616

JavaScript's utility _ belt

knex/knex 13125

A query builder for PostgreSQL, MySQL and SQLite3, designed to be flexible, portable, and fun to use.

graphql-nexus/schema 1838

Code-First, Type-Safe, GraphQL Schema Construction

graphile/starter 899

Opinionated quick-start with pre-built user account system for full-stack application development in React, Node.js, GraphQL and PostgreSQL. Powered by PostGraphile, TypeScript, Apollo Client, Graphile Worker, Graphile Migrate, Ant Design and Next.js

graphql-nexus/nexus-plugin-prisma 654

A plugin for Nexus that integrates Prisma

tgriesser/backbone-multi-router 10

Enable independent Routers which each match one or more routes for the current url fragment.

tgriesser/backbone-nested 4

Simple handling of nested Backbone views

tgriesser/asserts 3

Simple TypeScript assertion functions

delete branch tgriesser/jest

delete branch : tgriesser/fix/hoisting-order

delete time in a day

issue closedgraphql-nexus/schema

UnionType does not take UnionTypes

It is my understanding that a union Foo = Bar | Baz can also be used in a different union union Bum = Foo | Buz. But this currently gives the following error Expected Foo to be a objectType, saw GraphQLUnionType.

closed time in a day

Jomik

issue commentgraphql-nexus/schema

UnionType does not take UnionTypes

From the GraphQL Spec:

The member types of a Union type must all be Object base types; Scalar, Interface and Union types must not be member types of a Union. Similarly, wrapping types must not be member types of a Union.

I'm not sure the reasoning for not allowing unions to be members of unions, but this behavior is in fact spec compliant.

Jomik

comment created time in a day

issue closedgraphql-nexus/schema

Allow deprecation of connection fields

There is currently no way to deprecate a field created with the connectionField plugin.

This is pretty important for maintaining versionless schemas.

This should work exactly like it does for any other field:

t.connectionField('some_field', {
    deprecation: 'No longer safe to use',
    type: 'SomeType',
    nodes: async (root, _, ctx) => await root.genMyFields(ctx))
});

closed time in a day

MattGson

issue commentgraphql-nexus/schema

Allow deprecation of connection fields

Released in 0.17.0

MattGson

comment created time in a day

issue closedgraphql-nexus/schema

Allow setting description for connection fields

Currently there does not seem to be a way to specify a description for a field created with the connectionField plugin.

It seems that you should be able to do something like:

export const ThingsQuery = extendType({
  type: 'Query',
  definition(t) {
    t.connectionField('things', {
      type: 'Thing',
      description: 'Returns a list of things',
      nodes: (_root, _args, ctx) => ctx.db.findAllThings()
    });
  }
});

which would result the following in generated SDL:

type Query {
  """
  Returns a list of things
  """
  things(...)
}

This issue seems similar to #512

closed time in a day

brandondoran

issue commentgraphql-nexus/schema

Allow setting description for connection fields

Released in 0.17.0

brandondoran

comment created time in a day

pull request commentfacebook/jest

fix: Preserve order of jest calls when hoisting

@jeysal Looks great! One note would be that blacklist was renamed as denylist in babel 7.11 and will be fully removed in babel 8. I assume based on the currently dependency ranges it'd be best to keep as blacklist for now though, unless you wanted to bump deps to newer versions of babel.

tgriesser

comment created time in a day

issue commentgraphql-nexus/schema

Allow setting description for connection fields

Just merged this in #578 - should be out with a release soon

brandondoran

comment created time in 3 days

issue commentgraphql-nexus/schema

Allow deprecation of connection fields

Merged this in #578 - should be out with a release soon

MattGson

comment created time in 3 days

push eventgraphql-nexus/schema

Tim Griesser

commit sha cc12ec16fb5abfb533a1be36b89ec9fa1607b7ff

fix: add deprecated, description, nullable to connectionField (#578)

view details

push time in 3 days

delete branch graphql-nexus/schema

delete branch : tgriesser/fix/connectionPlugin-description

delete time in 3 days

PR merged graphql-nexus/schema

fix: add deprecated, description, nullable to connectionField
  • Adds description, deprecated, and nullable as possible options for the connectionField
  • Sets the correct path for prettier config when running the examples
+55 -10

1 comment

12 changed files

tgriesser

pr closed time in 3 days

PR opened graphql-nexus/schema

fix: add deprecated & description to connectionField plugin
  • Adds description, deprecated, and nullable as possible options for the connectionField
  • Sets the correct path for prettier config when running the examples
+55 -10

0 comment

12 changed files

pr created time in 3 days

push eventgraphql-nexus/schema

Tim Griesser

commit sha cb6bb1bf44f28df4a8eb5609d668281ff2603c48

Support nullable option in connectionField, fix prettier config

view details

push time in 3 days

issue commentgraphql-nexus/schema

Union's resolveType doesn't know about __typename

One of Nexus' opinions originally was not to attempt to support isTypeOf because it always felt clunky to have an exhaustive check on possible member types before failure, rather than always defining the resolveType as part of the interface / union type.

At least in my experience, it felt like having two ways to do the same thing felt odd / distracting, and you were better off just implementing resolveType in almost all cases - I do wonder if there are valid reasons you'd prefer / need isTypeOf over resolveType though.

resolveType error is on the union type definition config, a new field called resolveType. It will replace t.resolveType API. The reason we cannot use t.resolveType is that there is no way in TS to require, statically, for a function to be called by the user.

This sounds good to me. I am trying to remember if there was a typings reason for having t.resolveType rather than having it as a config member on union / interface types.

By default Nexus will only give the isTypeOf static feedback. However for teams working with different standards, they may change to enable a different set of the union checks.

Interesting to hear thoughts re: feedback above on the value of implementing isTypeOf in general. Hasn't seemed to be anything folks have complained about missing from graphql-js.

ThisIsMissEm

comment created time in 4 days

delete branch graphql-nexus/schema

delete branch : authorization

delete time in 4 days

PR closed graphql-nexus/schema

Authorization scope/auth type/feat

This PR is the beginning of an authorization strategy for GraphQL Nexus. Feedback welcome!

I added a field-level authorize method, but I'm not 100% convinced this should be the final solution here. Mainly wondering if there are things we can learn/adapt from graphql-ruby's approaches to authorization? Their concepts of "scoping", "authorization", "accessibility", and "visibility" are pretty interesting.

Goals:

  • Covers all of the major use cases
  • Type safety, as always
  • Simplicity (as much as we can), the fewer concepts/codepaths the better

Questions:

  • What are the major paths that folks would expect Nexus to reasonably cover? I don't mind building out a more robust layer around this, since it's a major pain-point when developing schemas.
  • Should we be opinionated here and require an authorize property by default on "root type" fields (Query, Mutation, Subscription), with the ability to disable with forceRootAuthorize: false on the makeSchema config? Or maybe the other way around... opt in?
+143 -8

27 comments

11 changed files

tgriesser

pr closed time in 4 days

pull request commentgraphql-nexus/schema

Authorization

Yep, I think we can close this for now. Might revisit object-level validation / field visibility at some point, but that can be a separate discussion.

tgriesser

comment created time in 4 days

PullRequestReviewEvent

pull request commentfacebook/jest

fix: Preserve order of jest calls when hoisting

Haven't had a chance to come back to this. If one of y'all want to take a stab at it, feel free.

tgriesser

comment created time in 8 days

created tagtgriesser/schemats

tagv6.1.0

Generate typescript interface definitions from SQL database schema

created time in 23 days

push eventtgriesser/schemats

Tim Griesser

commit sha a5e783d09fdc12bddabfef8f4b2b1eef120fcf2d

v6.1.0

view details

push time in 23 days

push eventtgriesser/schemats

Tim Griesser

commit sha 15f82558c03a1533728b57049ccc22504e09eff0

feat: support arbitrary sqlite3 queries

view details

push time in 23 days

push eventgraphql-nexus/schema

Tim Griesser

commit sha b4e0debd95052ff332e53b6b402a1fd47eab673e

feat: add onObjectDefinition / onInputObjectDefinition (#533)

view details

push time in 23 days

delete branch graphql-nexus/schema

delete branch : tgriesser/feat/plugin-onObjectDefinition

delete time in 23 days

PR merged graphql-nexus/schema

Reviewers
feat: add onObjectDefinition / onInputObjectDefinition

The onObjectDefinition plugin option allows for a plugin to declarative modify the definition of an object type.

For example:

const Post = objectType({
  name: 'Post',
  node: 'uuid',
  resolve(t) {
    t.string('name')
  }
})

This allows the plugin to intercept the t (definition block builder) after the fields are applied, and based on the presence of node in the object definition, add:

onObjectDefinition((t, config) => {
  if (config.node) {
    t.implements('Node')
    t.id('id', { 
      nullable: false,
      resolve: (root, args, ctx, info) => `${info.parentType.name}:${root[config.node]}`
    })
  }
})

Also added onInputObjectDefinition for symmetry, but not sure if it'd be useful yet.

+223 -17

2 comments

11 changed files

tgriesser

pr closed time in 23 days

push eventgraphql-nexus/schema

Tim Griesser

commit sha 219497accb616608bb0170397be0b9d0f5dc4ffd

Update codecov.yml

view details

push time in 23 days

push eventgraphql-nexus/schema

Tim Griesser

commit sha a158cb6a7fd8024092425f5be823a3d050d34f11

Only upload coverage from a single build

view details

push time in 23 days

push eventgraphql-nexus/schema

Tim Griesser

commit sha 393de57b29faa87cc3db0600137ba9baca3c790e

chore: update test in trunk.yml Running test:ci to trigger coverage

view details

Cyril Moreau

commit sha 0dd8ea367bccf6b9871b06e4270a771dc882484a

chore(docs): Fix a typo in 030-neuxs-framework-prisma-users.mdx (#537)

view details

Tim Griesser

commit sha babdb636b4d20fdb27d6924e5b12e33351f9dfbc

Merge branch 'develop' into tgriesser/feat/plugin-onObjectDefinition * develop: chore(docs): Fix a typo in 030-neuxs-framework-prisma-users.mdx (#537) chore: update test in trunk.yml

view details

Tim Griesser

commit sha 5e76694b8b72765d93e1032622fe5658447d0a85

Add docs for onObjectDefinition

view details

push time in 23 days

pull request commentgraphql-nexus/schema

feat: add onObjectDefinition / onInputObjectDefinition

@jasonkuhrt thinking about it more, it seems like this sort of thing could also be useful for Prisma, especially if we added a way to determine what fields may have been already defined in the "definition" block.

export const User = objectType({
  prismaModel: 'User',
})

export const Post = objectType({
  prismaModel: 'Post',
  definition(t) {
    t.string('title', {
       resolve: customResolver
    })
  }
})
tgriesser

comment created time in 23 days

PullRequestReviewEvent

Pull request review commentgraphql-nexus/schema

wip: list() & nonNull()

+import { GetGen } from '../typegenTypeHelpers'+import { AllNexusNamedTypeDefs } from './wrapping'+import { NexusTypes, withNexusSymbol } from './_types'++type AllNamedTypes = GetGen<'allNamedTypes', string> | AllNexusNamedTypeDefs++/**+ * list()+ */++type ListableTypes = AllNamedTypes | NexusNonNullDef<NonNullableTypes> | NexusListDef<ListableTypes>++export type NexusListDefConfig<TypeName extends ListableTypes> = {+  type: TypeName+}++export class NexusListDef<TypeName extends ListableTypes> {+  // @ts-ignore+  private _isNexusListDef: boolean = true++  constructor(readonly type: TypeName) {}+}++withNexusSymbol(NexusListDef, NexusTypes.List)++export function list<TypeName extends ListableTypes>(type: TypeName) {+  return new NexusListDef(type)+}++/**+ * nonNull()+ */++type NonNullableTypes = AllNamedTypes | NexusListDef<ListableTypes>

I wonder if we should just add NexusNonNullDef<NonNullableTypes> to this, so you can wrap nonNull(nonNull(...)) and have it be a no-op. IIRC that's how GraphQL's definition of non-nullable works

Weakky

comment created time in 25 days

push eventgraphql-nexus/schema

Tim Griesser

commit sha 393de57b29faa87cc3db0600137ba9baca3c790e

chore: update test in trunk.yml Running test:ci to trigger coverage

view details

push time in a month

push eventgraphql-nexus/schema

Tim Griesser

commit sha a8df05ced2d13cf27b00925f986c60e952db0976

chore: Use codecov/codecov-action GH action (#534)

view details

Tim Griesser

commit sha f9d68fa34f919263b98ba267e7b6b8f8fe7d7a37

Merge branch 'develop' into tgriesser/feat/plugin-onObjectDefinition

view details

push time in a month

push eventgraphql-nexus/schema

Tim Griesser

commit sha a8df05ced2d13cf27b00925f986c60e952db0976

chore: Use codecov/codecov-action GH action (#534)

view details

push time in a month

delete branch graphql-nexus/schema

delete branch : tgriesser/chore/use-codecov-action

delete time in a month

create barnchgraphql-nexus/schema

branch : tgriesser/chore/use-codecov-action

created branch time in a month

PR opened graphql-nexus/schema

feat: add onObjectDefinition / onInputObjectDefinition

The onObjectDefinition plugin option, allows for a plugin to declarative modify the definition of an object type.

For example:

const Post = objectType({
  name: 'Post',
  node: 'uuid',
  resolve(t) {
    t.string('name')
  }
})

This allows the plugin to intercept the t (definition block builder) after the fields are applied, and based on the presence of node in the object definition, add:

(t, config) => {
  if (config.node) {
    t.implements('Node')
    t.id('id', { 
      nullable: false,
      resolve: (root, args, ctx, info) => `${info.parentType.name}:${root[config.node]}`
    })
  }
}

Also added onInputObjectDefinition for symmetry, but not sure if it'd be useful yet.

+172 -16

0 comment

7 changed files

pr created time in a month

create barnchgraphql-nexus/schema

branch : tgriesser/feat/plugin-onObjectDefinition

created branch time in a month

pull request commentgraphql-nexus/schema

docs: Fix ts-node-dev flag in the docs

Thanks!

Dremora

comment created time in a month

push eventgraphql-nexus/schema

Kirill Korolyov

commit sha 489b5ab94fe54a167e68661ffb9c03734601a78c

docs: Fix ts-node-dev flag in the docs (#529) It has been renamed: https://github.com/whitecolor/ts-node-dev/issues/186

view details

push time in a month

PR merged graphql-nexus/schema

docs: Fix ts-node-dev flag in the docs

It has been renamed: https://github.com/whitecolor/ts-node-dev/issues/186

+1 -1

1 comment

1 changed file

Dremora

pr closed time in a month

push eventgraphql-nexus/schema

Tim Griesser

commit sha 85bf467cde3510d9923adf027557f24e0ffe31f6

chore: Restoring codecov (#532)

view details

push time in a month

delete branch graphql-nexus/schema

delete branch : tgriesser/chore/restore-codecov

delete time in a month

push eventgraphql-nexus/schema

Tim Griesser

commit sha d82d422ecedfdaa55b4a9d82b0e111c674bb93fa

Provide via --token

view details

push time in a month

push eventgraphql-nexus/schema

Tim Griesser

commit sha 995e5df0aa8b8c109ad9ba209184034bb3cf28ba

Access the codecov token

view details

push time in a month

create barnchgraphql-nexus/schema

branch : tgriesser/chore/restore-codecov

created branch time in a month

push eventgraphql-nexus/schema

Tim Griesser

commit sha 8f3189c0698edfe8e2614bee237cbfd339b7c285

chore: Keep prettier config local to the project (#531)

view details

push time in a month

delete branch graphql-nexus/schema

delete branch : tgriesser/chore/prettier-config

delete time in a month

PR merged graphql-nexus/schema

chore: Keep prettier config local to the project
  • Keeps the prettier config local to the project (keeping at 110 to reduce diff, but will likely revert to 80)
  • Format examples
+146 -151

0 comment

8 changed files

tgriesser

pr closed time in a month

PR opened graphql-nexus/schema

chore: Keep prettier config local to the project
  • Keeps the prettier config local to the project (keeping at 110 to reduce diff, but will likely revert to 80)
  • Format examples
+146 -151

0 comment

8 changed files

pr created time in a month

create barnchgraphql-nexus/schema

branch : tgriesser/chore/prettier-config

created branch time in a month

push eventgraphql-nexus/schema

Tim Griesser

commit sha 2bceeb915fe2d78c572d84f856989fe46b97b1a8

chore: Bumping deps & adding scripts for running examples (#530)

view details

push time in a month

delete branch graphql-nexus/schema

delete branch : tgriesser/chore/fix-examples

delete time in a month

PR merged graphql-nexus/schema

Reviewers
chore: Bumping deps & adding scripts for running examples

Looks like the gulp tasks used to do the example linking got removed w/ the website overhaul. Also bumped graphql and related dependencies in order to get things running again.

+12114 -5880

0 comment

36 changed files

tgriesser

pr closed time in a month

push eventgraphql-nexus/schema

Tim Griesser

commit sha b67fc9d75f0753c17c323738c77f00d5431c308a

Fix example tsc

view details

push time in a month

push eventgraphql-nexus/schema

Tim Griesser

commit sha 3a6a661028fad63bd4216fdc59d456da67daf54f

More fixes

view details

push time in a month

push eventgraphql-nexus/schema

Tim Griesser

commit sha 23e05ca150d93d43c8bdabd9b38e9f2c8c6f325f

Fix the yarn lockfiles

view details

push time in a month

push eventgraphql-nexus/schema

Tim Griesser

commit sha 14e8c5793caaf9498ee3ca7bff1418f139df50a4

Bump tsc in examples

view details

push time in a month

pull request commentgraphql-nexus/schema

feat: allow interfaces to implement other interfaces

Cool stuff, definitely want to get this in here. Mind getting it up-to-date with develop?

No need to call t.implements with all the interfaces like it is required on grapqhl. It automatically pulls all the transitive "implements" when building the schema.

Sounds like a good feature!

Check for circular dependencies before building the types in order to avoid stack overflow exceptions.

Nice

BTW: I missed having some sort of autoformatter when working on this. Seeing that you use prettier on graphql-nexus/nexus would you accept a PR adding it here with the same config?

Yeah, it definitely used to be in here. I'm guessing with all the shuffling around with Prisma things it got lost in the mix. Feel free to add!

santialbo

comment created time in a month

PullRequestReviewEvent

Pull request review commentgraphql-nexus/schema

feat: output types & list items are now nullable by default

 const types = [   }),   queryField('intList', {     type: 'Int',-    list: true,+    list: [true],     resolve: () => [1, 2, null],   }),   queryField('userList', {     type: 'User',-    list: true,+    list: [true],

@homoky we can keep it around for a bit (or forever) I suppose - just like the idea of consolidating on one way to do things when it's practical.

Weakky

comment created time in a month

PR opened graphql-nexus/schema

chore: Bumping deps & adding scripts for running examples

Looks like the gulp tasks used to do the example linking got removed w/ the website overhaul. Also bumped graphql and related dependencies in order to get things running again.

+7956 -4055

0 comment

32 changed files

pr created time in a month

create barnchgraphql-nexus/schema

branch : tgriesser/chore/fix-examples

created branch time in a month

create barnchtgriesser/cluster-rpc

branch : master

created branch time in a month

created repositorytgriesser/cluster-rpc

created time in a month

create barnchtgriesser/node-package-template

branch : master

created branch time in a month

created repositorytgriesser/node-package-template

Setting up some defaults for authoring a new TS package

created time in a month

PR opened facebook/jest

refactor(fake-timers): don't setup fakeTimerAPIs unless needed

Summary

Notices that the mock fn's for the legacy fake timers are created immediately, even if they're never used. Since _createMocks is called in useFakeTimers, it seems we should be able to remove this from the constructor and only set them up if needed.

Test plan

No functional change, existing tests should pass

+1 -2

0 comment

1 changed file

pr created time in a month

Pull request review commentgraphql-nexus/schema

feat: output types & list items are now nullable by default

 const types = [   }),   queryField('intList', {     type: 'Int',-    list: true,+    list: [true],     resolve: () => [1, 2, null],   }),   queryField('userList', {     type: 'User',-    list: true,+    list: [true],

The array syntax for list has always felt kind of awkward. Was thinking we could deprecate the list property on the object here, instead adding list and nonNull helper fns similar to graphene https://docs.graphene-python.org/en/latest/types/list-and-nonnull/, so this would become:

import { list, queryField } from '@nexus/schema'

queryField('userList', {
  type: list('User'),
  resolve: () => [null, Promise.resolve(null), null],
})

Haven't taken a shot at it yet, but I don't think it'd be too difficult to type / unwrap as necessary.

Weakky

comment created time in a month

PullRequestReviewEvent
PullRequestReviewEvent

pull request commentfacebook/jest

fix: Preserve order of jest calls when hoisting

Sidenote: In adding the unit tests, and trying it out with some other issues around @jest/globals like #10218 and #10147, I feel like there's a number of cases that aren't fully covered by the globals change/refactor.

Hoping this will be a good starting place for addressing some of those issues.

tgriesser

comment created time in a month

push eventtgriesser/jest

Tim Griesser

commit sha ecdee37c130bf280a0a5f8fbdbb701b5f269f5c7

Remove extraneous e2e test

view details

push time in a month

Pull request review commentfacebook/jest

fix: Preserve order of jest calls when hoisting

+/**+ * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.+ *+ * This source code is licensed under the MIT license found in the+ * LICENSE file in the root directory of this source tree.+ *+ */++'use strict';++import a from '../__test_modules__/a';++// These will all be hoisted above imports+jest.enableAutomock();

Can probably remove this e2e test now that there's more direct snapshot tests, will do that after the latest tests complete.

tgriesser

comment created time in a month

PullRequestReviewEvent

pull request commentfacebook/jest

fix: Preserve order of jest calls when hoisting

@SimenB ok, tried a new approach which seems to work decent enough - added some unit tests as you mentioned and fixed an e2e test which seemed to only be passing due to the previously incorrect hoisting behavior.

tgriesser

comment created time in a month

push eventtgriesser/jest

Tim Griesser

commit sha eada56707a1441ed616abc7364ede7ae9857f675

Add Copyright header, better name data keys

view details

Tim Griesser

commit sha ce68bb2591cc653768099cbd640b613f06693d00

Fix broken integration test due to proper hoist ordering

view details

push time in a month

push eventtgriesser/jest

Tim Griesser

commit sha 5daa26967d88562d27fe21cfbeee8f08459f5c28

Fix babel plugin, add snapshot tests

view details

push time in a month

pull request commentfacebook/jest

fix: Preserve order of jest calls when hoisting

Haven't quite figured out how to adapt the Babel plugin here correctly. Tried a few things, including collecting the nodes during traversal and then adding the nodes on exit:

const onExitBlock = (node: NodePath<Block>) => {
  const hoistNodes = node.getData('__babelJestHoistNodes');
  if (hoistNodes) {
    node.unshiftContainer('body', hoistNodes);
  }
};

// ...
{
  post({path: program}: {path: NodePath<Program>}) {
    program.traverse({
      Block: {
        exit: onExitBlock,
      },
      CallExpression: callExpr => {
        const {
          node: {callee},
        } = callExpr;
        if (
          isIdentifier(callee) &&
          callee.name === this.jestObjGetterIdentifier?.name
        ) {
          const mockStmt = callExpr.getStatementParent();

          if (mockStmt) {
            const mockStmtNode = mockStmt.node;
            const mockStmtParent = mockStmt.parentPath;
            if (mockStmtParent.isBlock()) {
              mockStmt.remove();
              const hoistNodes =
                mockStmtParent.getData('__babelJestHoistNodes') ?? [];
              hoistNodes.push(mockStmtNode);
              mockStmtParent.setData('__babelJestHoistNodes', hoistNodes);
            }
          }
        }
      },
    });
    onExitBlock(program as NodePath<Block>);
  },
}

But for some reason the nodes aren't being added properly. Will try a few more things, but would love some eyes from anyone a little more versed in babel transforms.

tgriesser

comment created time in a month

push eventtgriesser/jest

Tim Griesser

commit sha 25014529abdc963eefb4d0e6ce1407a9d2115159

Fix changelog issue number

view details

push time in a month

push eventtgriesser/jest

Tim Griesser

commit sha 2e2f2a66efc4875c3b93d295956956b0909dd725

Fix hoist implementation, update CHANGELOG.md

view details

push time in a month

PR opened facebook/jest

fix: Preserve order of jest calls when hoisting

<!-- Thanks for submitting a pull request! Please provide enough information so that others can review your pull request. The two fields below are mandatory. -->

<!-- Please remember to update CHANGELOG.md in the root of the project if you have not done so. -->

Summary

It looks like the changes to hoisting in #9806 have incorrectly ordered hoisted jest in the same block, because they are unshifted on the containing scope individually, rather than collectively after walking the AST.

Test plan

Added an integration test in e2e/babel-plugin-jest-hoist.

import a from '../__test_modules__/a';

// These will all be hoisted above imports
jest.enableAutomock();
jest.disableAutomock();

Before the change:

'use strict';

// These will all be hoisted above imports
_getJestObj().disableAutomock();

_getJestObj().enableAutomock();

// ... rest of spec

After change:

'use strict';

// These will all be hoisted above imports
_getJestObj().enableAutomock();

_getJestObj().disableAutomock();

// ... rest of spec
+24 -1

0 comment

2 changed files

pr created time in a month

push eventtgriesser/jest

Tim Griesser

commit sha bd3757eb514b5f51333c2f98a7eeb6c6b5ff3387

fix: Unshift mock statements in the order they are defined

view details

push time in a month

create barnchtgriesser/jest

branch : tgriesser/fix/hoisting-order

created branch time in a month

fork tgriesser/jest

Delightful JavaScript Testing.

https://jestjs.io

fork in a month

issue commentgraphql-nexus/schema

required extendConnection field resolvers for connectionPlugin connection when providing field resolve function

@dpekkle It is, yes. Have a few things I've been meaning get to here - I'll try and block off some time this week to get to this.

Luka4ever

comment created time in 2 months

MemberEvent

issue commentgraphql-nexus/schema

Typings are broken

Just hit this as well, looks to be due to the changes in https://github.com/graphql-nexus/schema/pull/462 - can reproduce by installing the latest @nexus/schema and "skipLibCheck": false.

I think might have been why I punted on adding a dedicated subscriptionType builder in the first place. It can't easily implement ObjectDefinitionBlock because this implements OutputDefinitionBlock which includes any of the JIT "plugin" fields added to the builder, which are going to have different config signatures.

I suppose you may be able to make this work by running both conditionals for the ScalarSubSpread and SubscribeFieldConfig through the ScalarOutSpread and FieldOutConfig with a ternary - that way the configs would be the same structurally for both class methods.

cyrus-za

comment created time in 2 months

startedFormidableLabs/urql

started time in 2 months

more