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

Alternative to eager loading? #11

Open
jgrau opened this issue Oct 10, 2019 · 3 comments
Open

Alternative to eager loading? #11

jgrau opened this issue Oct 10, 2019 · 3 comments

Comments

@jgrau
Copy link

jgrau commented Oct 10, 2019

Hi. First of all thanks for this gem. I'm trying to incorporate it into an existing rails 5.2 application but run into some weird/fun loading issues. In various initializers I have pieces of code that is required for my application to boot. For example I define a class that the application code uses etc. When I install graphoid by adding the gem to the bundle and creating the initializer as per the instructions, I would get errors for example for this missing class. If I rename config/initializers/graphoid.rb to config/initializers/zz_graphoid.rb (so it is the last initializer to run), booting the app works as expected.

From looking at the sourcecode of the gem I suspect it's because it asks rails to eager_load. I could be wrong :)

Is there an alternative approach? Relying on the load order seems a little brittle... :)

@maxcoto
Copy link
Owner

maxcoto commented Nov 26, 2019

@jgrau thank you for using this gem ! unfortunately I stopped maintaining it because of lack of support/usage, so if you find a solution for the loading order or the eager load behaviors please feel free to send a PR, I will be happy to review it !

@jgrau
Copy link
Author

jgrau commented Dec 1, 2019

Ah, no worries. Thanks for replying. We put our project on pause but might pick it up again.

@maxcoto
Copy link
Owner

maxcoto commented Dec 12, 2019

@jgrau development is on again. I am sending a PR to upgrade versions and use the latest graphql-ruby out there.
I've been going through the initialization process thinking on how to load things in a lazy way.
Will get back with news soon !

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

No branches or pull requests

2 participants