WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

How to handle models that have multiple words? #167

@jimmiejackson414-zz

Description

@jimmiejackson414-zz

Hi there, I've got an odd sort of question.

I have a model Shopping List Item. I've defined it as such:

import { Model } from '@vuex-orm/core';

export default class ShoppingListItem extends Model {
  static entity = 'shopping_list_items';

  static fields () {
    return {
      id: this.attr(null),
      title: this.string(''),
      checked: this.boolean(false),
      quantity: this.number(0),
      created_at: this.attr(null),
      updated_at: this.attr(null),
    };
  }
}

When I attempt to run a $save() and $push(), I receive the error: Couldn't find Type of name Shopping_list_itemInput in the GraphQL Schema.

Theoretically I could change the name of the input on the backend to Shopping_list_itemInput, however I think you'll agree that this is not optimal. Do you have any suggestions for naming multi-worded models?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions