Skip to content
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

TS: Custom input names for actions #85

Merged
merged 2 commits into from
Aug 4, 2020
Merged

TS: Custom input names for actions #85

merged 2 commits into from
Aug 4, 2020

Conversation

lolopinto
Copy link
Owner

this makes it so that if we have 2 create or edit actions, they work

  actions: Action[] = [
    {
      operation: ActionOperation.Create,
      fields: createFields,
      // when all 3 presented, things are fine
      actionName: "UserCreateRequesterAction",
      graphQLName: "userCreateRequester",
      inputName: "UserCreateRequesterInput",
    },
    {
      operation: ActionOperation.Create,
      fields: createFields,
      actionName: "UserCreateVolunteerAction",
      graphQLName: "userCreateVolunteer",
      inputName: "UserCreateVolunteerInput",
    },
  ];

we still need a lot of work to support other types e.g. add/remove edges

still need better default behavior when all 3 custom fields aren't provided

still need better to fix inconsistency in naming conventions of input names e.g. default is CreateUserAction for action name but UserCreateInput for input names. The latter is fine for graphql but dubious for ents

Also, this stems from inconsistency in default behavior e.g. CreateUserAction and 'userCreate`

@lolopinto lolopinto merged commit d93be1f into master Aug 4, 2020
lolopinto added a commit that referenced this pull request Aug 6, 2020
fix 2 bugs:
1/ multiple reserveImport of the same path breaking e.g. in User module where multiple things referencing Contact
2/ delete action inputName panicking per #85
lolopinto added a commit that referenced this pull request Aug 6, 2020
fix 2 bugs:
1/ multiple reserveImport of the same path breaking e.g. in User module where multiple things referencing Contact
2/ delete action inputName panicking per #85
lolopinto added a commit that referenced this pull request Aug 6, 2020
* generate schema.ts and index.ts to make it easier for clients to start

* run `tsent codegen` on example and confirm that everything is kosher

fix 2 bugs:
1/ multiple reserveImport of the same path breaking e.g. in User module where multiple things referencing Contact
2/ delete action inputName panicking per #85
lolopinto added a commit that referenced this pull request Aug 6, 2020
* generate schema.ts and index.ts to make it easier for clients to start

* run `tsent codegen` on example and confirm that everything is kosher

fix 2 bugs:
1/ multiple reserveImport of the same path breaking e.g. in User module where multiple things referencing Contact
2/ delete action inputName panicking per #85

* generate "full paths" for custom types so we end with consistent types and can merge paths when importing happens across locaitons
@lolopinto lolopinto deleted the custom-input-names branch September 22, 2020 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant