-
Notifications
You must be signed in to change notification settings - Fork 44
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
Pass in initialized schema as an option #107
Conversation
Looks good! I don't see a reason why this can't work.
|
Will raise an error if both schema and schema_path are provided and add to README. Thanks @dblock! |
6e413c6
to
4535bd3
Compare
@dblock raises an error from the constructor of both schema_path and schema are given as an option. Also added some documentation. Let me what you think. Thanks! |
4535bd3
to
007071c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some language nits, please?
007071c
to
56495fd
Compare
Addressed all comments. Have another look when you get a chance. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One more nit in the markdown and we're good to go. Consider the others. Thanks for hanging in here with me!
56495fd
to
3ff5134
Compare
Updated with the latest requested changes. Thanks for feedback! |
Rubocop is failing, https://github.com/ashkan18/graphlient/actions/runs/6510603592/job/17703718899?pr=107, needs a Also I was thinking that this code looks a bit awkward, we pass both
Can we simplify further or rewrite this example not to use |
Running into trouble on my local machine running rubocop. First trying with ruby-3.2.2 I get:
Noticed the rubocop build uses ruby-2.7.2 so tried that and the funny thing is I get a message from rubocop saying this ruby version is not supported. I'm confused how it is working in the build.
Tried install ruby-2.5 since i had come this far but that gave me all sorts of errors including that it's not supported:
I finally got rubocop to somewhat work by changing back to ruby-2.7.2 and upgrading locally to rubocop 0.80.1. I had to also change Can't explain why it works in build, but maybe we should update rubocop to the latest version? |
dc294ab
to
151d581
Compare
For now I took away the schema.http. Thinking we could simplify further by allowing for passing in the schema as the first argument since the schema has a reference to the url.
|
You do need to add this too. |
I think you may see different results with doing
We should in a separate PR. |
151d581
to
be957cd
Compare
Added changelog entry. Sorry I missed that. Thanks! |
Merged, thanks! |
Thanks @dblock! |
Not sure if this is a problem others have run into or if there is a better solution. We are using Graphlient within sidekiq and since it is a multithreaded process, we are creating an instance of
Graphlient::Client
during each job execution. Even though we are caching our schema on disk, our schema.json is large and there is significant time and memory spent loading the schema from disk. My thought is that we might be able to instead load one schema in a rails initializer and share it among all threads. Thus far it has seemed to work in a multithreaded sidekiq instance:initializer code
Initialize graphlient client
Let me know what you think. Is it fully theadsafe to share a
Graphlient::Schema
like this?