You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.
I am trying to abstract the different queries made (and welcoming suggestions!).
I have file:
def self.included(child_class)
child_class.field(:companies, [Types::CompanyType], null: false)
child_class.field(:company, Types::CompanyType, null: false) do
argument :id, Integer, required: true
end
end
# then implement the field
def companies
CompanyPolicy::Scope.new(context[:current_user], ::Company).resolve
end
def company(id:)
::Company.find(id)
end
end```
That is then included in my query type:
```class Types::QueryType < GraphQL::Schema::Object
graphql_name "Query"
include Queries::Models::Company
end
```.
My challenge is that `CompanyPolicy::Scope.new(context[:current_user], ::Company).resolve` works for the time being but not great for the long run. How can I change this up to work with this?
Also, in the docs there is reference to `GraphQL::Schema::FieldType` then there is no more mention of it in the README, how is it being used?
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I am trying to abstract the different queries made (and welcoming suggestions!).
I have file:
The text was updated successfully, but these errors were encountered: