{"action":"created","issue":{"url":"https://api.github.com/repos/Vincit/objection-graphql/issues/26","repository_url":"https://api.github.com/repos/Vincit/objection-graphql","labels_url":"https://api.github.com/repos/Vincit/objection-graphql/issues/26/labels{/name}","comments_url":"https://api.github.com/repos/Vincit/objection-graphql/issues/26/comments","events_url":"https://api.github.com/repos/Vincit/objection-graphql/issues/26/events","html_url":"https://github.com/Vincit/objection-graphql/issues/26","id":276366509,"number":26,"title":"Optimal usage of the db schema name in GraphQL schema ","user":{"login":"nasushkov","id":7974392,"avatar_url":"https://avatars0.githubusercontent.com/u/7974392?v=4","gravatar_id":"","url":"https://api.github.com/users/nasushkov","html_url":"https://github.com/nasushkov","followers_url":"https://api.github.com/users/nasushkov/followers","following_url":"https://api.github.com/users/nasushkov/following{/other_user}","gists_url":"https://api.github.com/users/nasushkov/gists{/gist_id}","starred_url":"https://api.github.com/users/nasushkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nasushkov/subscriptions","organizations_url":"https://api.github.com/users/nasushkov/orgs","repos_url":"https://api.github.com/users/nasushkov/repos","events_url":"https://api.github.com/users/nasushkov/events{/privacy}","received_events_url":"https://api.github.com/users/nasushkov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-11-23T13:00:42Z","updated_at":"2017-11-25T17:57:11Z","closed_at":null,"author_association":"NONE","body":"A few days ago I switched to a named schema for my DB tables. So right now I ended up with prefixing all table references in my models with the DB schema name. However, I don't want my GraphQL schema to be prefixed with the DB schema name. Is there any workaround for this case?"},"comment":{"url":"https://api.github.com/repos/Vincit/objection-graphql/issues/comments/346955853","html_url":"https://github.com/Vincit/objection-graphql/issues/26#issuecomment-346955853","issue_url":"https://api.github.com/repos/Vincit/objection-graphql/issues/26","id":346955853,"user":{"login":"nasushkov","id":7974392,"avatar_url":"https://avatars0.githubusercontent.com/u/7974392?v=4","gravatar_id":"","url":"https://api.github.com/users/nasushkov","html_url":"https://github.com/nasushkov","followers_url":"https://api.github.com/users/nasushkov/followers","following_url":"https://api.github.com/users/nasushkov/following{/other_user}","gists_url":"https://api.github.com/users/nasushkov/gists{/gist_id}","starred_url":"https://api.github.com/users/nasushkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nasushkov/subscriptions","organizations_url":"https://api.github.com/users/nasushkov/orgs","repos_url":"https://api.github.com/users/nasushkov/repos","events_url":"https://api.github.com/users/nasushkov/events{/privacy}","received_events_url":"https://api.github.com/users/nasushkov/received_events","type":"User","site_admin":false},"created_at":"2017-11-25T17:57:11Z","updated_at":"2017-11-25T17:57:11Z","author_association":"NONE","body":" @koskimas Thanks for all your tips. My temp solution was overriding _getTableName_ in the base class (I used two base classes for each schema):\r\n```\r\nexport default class BaseModel extends Model {\r\n    static dbSchemaName = 'myschema'\r\n    static getTableName(){\r\n        const tableName = super.getTableName()\r\n        return `${this.dbSchemaName}.${tableName}`\r\n    }\r\n}\r\n```\r\nThen I just set the _tableName_ without prefix. \r\n\r\n```\r\nexport default class Company extends BaseModel {\r\n    static tableName = 'company'\r\n}\r\n```\r\n\r\nAlthough that workaround worked for me, it seems that it's tightly coupled with the current internal implementation, so I'd better go with your solution.\r\n"}}
{"actor":{"display_login":"nasushkov"}}