
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
This should help you to install graphql and setup the basics on any new rails application.
Add the gem to the Gemfile
gem 'cm-graphql'
If this is the first time graphql is getting added to the project, run the following generator
rails g cm_graphql:add_graphql
This will run the graphql generator graphql:install
and copy the graphql schema template.
Another generator to help you get started with a basic list endpoint is
rails g cm_graphql:list_api model_name
rails g cm_graphql:list_api course
# Sample grapqhl request
query {
courses(paging: {
pageNo: 1
perPage: 100
}) {
paging {
currentPage
totalPages
totalCount
}
data {
id
name
}
}
}
This will add the necessary files to the application.
Mount the engine at
mount CmGraphql::Engine => "/cm-graphql"
And you are done, you can test out the pagination.
page
and per
methods. These methods are used to set the page no and records per page of a model.app/graphql/types/inputs/base/paging.rb
exposes a interface to the frontend where the frontend can enter page no and records per page.list
method on the model. This method is inherited by the model from the paginator concern.app/graphql/types/objects/base/paging_type.rb
is used to represent the paging data to the frontend.app/graphql/types/objects/example_list_type.rb
.FAQs
Unknown package
We found that cm-graphql demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.